Minimal Regexp Matches, How To?
Posted: Fri Nov 30, 2001 11:36 am
How do I perform a minimal character regexp match?
Example:
For the string "one two three" the regexp "o.*e" matches the entire string. However, I want a regular expression that matches the shortest substring beginning with "o" and ending with "e", that is "one" in this case (with the next match being "o thre" and not "o three").
Anyone knows? Is it at all possible?
Example:
For the string "one two three" the regexp "o.*e" matches the entire string. However, I want a regular expression that matches the shortest substring beginning with "o" and ending with "e", that is "one" in this case (with the next match being "o thre" and not "o three").
Anyone knows? Is it at all possible?