Regex to identify asp.net server control in a given html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Regex to identify asp.net server control in a given html

    I am not sure if it is the right forum for Regex topic. If not, please point
    me the right forum.
    For a given HTML, I need to identify each asp.net server control. I am not
    an expert in regex, can someone give me a hint to write it?

    In the HTML, I need to identity the patterns for
    <tag * runat="server" * />
    or <tag * runat="server" * > * </tag>
    In which tag is in the pattern of *:*

    Then I need to get the start index and end index of the string that match
    the pattern.
    Thank you very much for your help!


  • Chris Calzaretta

    #2
    Re: Regex to identify asp.net server control in a given html

    You can loop thorugh the controls in the codebehind
    controls.count
    Why are you searching the page in html. Are you stealing somebody elses
    page?



    "John" <John@hotmail.c om> wrote in message
    news:O2%23ZN33E FHA.1396@tk2msf tngp13.phx.gbl. ..[color=blue]
    >I am not sure if it is the right forum for Regex topic. If not, please
    >point
    > me the right forum.
    > For a given HTML, I need to identify each asp.net server control. I am not
    > an expert in regex, can someone give me a hint to write it?
    >
    > In the HTML, I need to identity the patterns for
    > <tag * runat="server" * />
    > or <tag * runat="server" * > * </tag>
    > In which tag is in the pattern of *:*
    >
    > Then I need to get the start index and end index of the string that match
    > the pattern.
    > Thank you very much for your help!
    >
    >[/color]


    Comment

    • John

      #3
      Re: Regex to identify asp.net server control in a given html

      I need to analyse a ascx file, get all the server control, as well as
      getting none server control tags into literal controls. It has nothing to do
      stealing other pages. It is my own project. Thanks.



      "Chris Calzaretta" <ccalzaretta@ho tmail.com> wrote in message
      news:Oa9v073EFH A.3536@TK2MSFTN GP15.phx.gbl...[color=blue]
      > You can loop thorugh the controls in the codebehind
      > controls.count
      > Why are you searching the page in html. Are you stealing somebody elses
      > page?
      >
      >
      >
      > "John" <John@hotmail.c om> wrote in message
      > news:O2%23ZN33E FHA.1396@tk2msf tngp13.phx.gbl. ..[color=green]
      > >I am not sure if it is the right forum for Regex topic. If not, please
      > >point
      > > me the right forum.
      > > For a given HTML, I need to identify each asp.net server control. I am[/color][/color]
      not[color=blue][color=green]
      > > an expert in regex, can someone give me a hint to write it?
      > >
      > > In the HTML, I need to identity the patterns for
      > > <tag * runat="server" * />
      > > or <tag * runat="server" * > * </tag>
      > > In which tag is in the pattern of *:*
      > >
      > > Then I need to get the start index and end index of the string that[/color][/color]
      match[color=blue][color=green]
      > > the pattern.
      > > Thank you very much for your help!
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Chris Calzaretta

        #4
        Re: Regex to identify asp.net server control in a given html

        Ok my question then is why are you doing by searhing the html. Why not use
        the code behind to see what controls are on the page


        "John" <John@hotmail.c om> wrote in message
        news:OSZxUD4EFH A.2828@TK2MSFTN GP09.phx.gbl...[color=blue]
        >I need to analyse a ascx file, get all the server control, as well as
        > getting none server control tags into literal controls. It has nothing to
        > do
        > stealing other pages. It is my own project. Thanks.
        >
        >
        >
        > "Chris Calzaretta" <ccalzaretta@ho tmail.com> wrote in message
        > news:Oa9v073EFH A.3536@TK2MSFTN GP15.phx.gbl...[color=green]
        >> You can loop thorugh the controls in the codebehind
        >> controls.count
        >> Why are you searching the page in html. Are you stealing somebody elses
        >> page?
        >>
        >>
        >>
        >> "John" <John@hotmail.c om> wrote in message
        >> news:O2%23ZN33E FHA.1396@tk2msf tngp13.phx.gbl. ..[color=darkred]
        >> >I am not sure if it is the right forum for Regex topic. If not, please
        >> >point
        >> > me the right forum.
        >> > For a given HTML, I need to identify each asp.net server control. I am[/color][/color]
        > not[color=green][color=darkred]
        >> > an expert in regex, can someone give me a hint to write it?
        >> >
        >> > In the HTML, I need to identity the patterns for
        >> > <tag * runat="server" * />
        >> > or <tag * runat="server" * > * </tag>
        >> > In which tag is in the pattern of *:*
        >> >
        >> > Then I need to get the start index and end index of the string that[/color][/color]
        > match[color=green][color=darkred]
        >> > the pattern.
        >> > Thank you very much for your help!
        >> >
        >> >[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...