unicorn_rm
asked on
How to generate a string from a Regular Expression?
I have a regular expression using which i need to generate its corresponding string token..
Perhaps you mean to show the string representation of a regular expression in memory? The following code snippet shows how to print the internal regular expression as it was passed into the regex constructor. It prints the following:
[hH]ello\s+[wW]orld$
[hH]ello\s+[wW]orld$
// output the internal regular expression
Regex re = new Regex(@"[hH]ello\s+[wW]orld$");
Debug.WriteLine(re.ToString());
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what kind of correspondence are you talking about?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i wasn't making a serious suggestion... i was attempting to demonstrate the futility of attempting it.
;-)
then I think we made the right point together :D
then I think we made the right point together :D
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice one, I particularly like the Explain module (I don't really see the point in Genex... but hey, if that's the request ;-)
I think these answers are very valuable and all that for 50p ;-) ....but the q. has been abandoned since the start...
I think these answers are very valuable and all that for 50p ;-) ....but the q. has been abandoned since the start...
This question received ample coverage, multiple experts come to the same conclusion: "cannot be done" unless you have infinite time/space.
http:#24744034 (abel) shows how to tell the string repres. of a regex
http:#24887998 (tazmaster) explains the futility of getting matching strings
http:#24895361 (abel) elaborates on that
http:#24902652 (ozo) giving another angle with Explain and GenEx
Suggestion: equal split between http:#24887998 (tazmaster), http:#24895361 (abel) and http:#24902652 (ozo).
http:#24744034 (abel) shows how to tell the string repres. of a regex
http:#24887998 (tazmaster) explains the futility of getting matching strings
http:#24895361 (abel) elaborates on that
http:#24902652 (ozo) giving another angle with Explain and GenEx
Suggestion: equal split between http:#24887998 (tazmaster), http:#24895361 (abel) and http:#24902652 (ozo).
Mention you requirement in detail.