Re: regex - should be simple

Tech-Archive recommends: Fix windows errors by optimizing your registry



David Browne wrote:

You need to restrict what's matched by the first group, then things should work. Like this:

 ([^;]*);(.*)


(.*?);(.*)

already does this.

I know that. But the OP was stating it didn't work for him, so I thought I'd just suggest an alternative - one that I actually like to use because it specifies more cleary how the match works, thereby making it more readable.


But you're right, that expression, which the OP also gave, should really work with the sample string given.


Oliver Sturm -- Expert programming and consulting services available See http://www.sturmnet.org (try /blog as well) .