1

I have this regular expression in python:

'<input type="hidden" name="GALX" value="(?P<galx>[a-zA-Z0-9_]+)">'  

I want an equivalent regular expression string for C#. This string gives a parsing error in c#. Thanks in advance.

I've tried this:

Regex rc = new Regex("<input type=\"hidden\" name=\"GALX\" value=\"(?P<galx>[a-zA-Z0-9_]+)\">");  

It gives me this error:

parsing \"<input type=\"hidden\" name=\"GALX\" value=\"(?P<galx>[a-zA-Z0-9_]+)\">\" - Unrecognized grouping construct.
Alan Moore
  • 73,866
  • 12
  • 100
  • 156
Uzair Farooq
  • 917
  • 3
  • 15
  • 25
  • 1
    Obligatory: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags – Thanatos Jan 25 '12 at 07:53

1 Answers1

0

If you remove the "P" so that the "<" is right after the "?" it parses fine.

Note .NET grouping syntax.