A
Aaron
Hi,
I'm having a tricky problem where I want to accept a regular expression
pattern from user input but can't get teh escape characters to be prcoessed
correctly. If I take the same pattern and declare it in code with a
preceeding @ character it works fine.
To get the pattern to work from teh suer all \ have to be escaped, e.g.
instead of \d a user would have to enter \\d.
Is there anyway to convert a normal string to a verbatim string or some
other way to get a string treated as a verbatim string by Regex?
Regards,
Aaron
I'm having a tricky problem where I want to accept a regular expression
pattern from user input but can't get teh escape characters to be prcoessed
correctly. If I take the same pattern and declare it in code with a
preceeding @ character it works fine.
To get the pattern to work from teh suer all \ have to be escaped, e.g.
instead of \d a user would have to enter \\d.
Is there anyway to convert a normal string to a verbatim string or some
other way to get a string treated as a verbatim string by Regex?
Regards,
Aaron