Re: regex - should be simple

Tech-Archive recommends: Speed Up your PC by fixing your registry



lit@xxxxxxxxxxxx wrote:

I want to capture everything up to the first semicolon, and
everything after.  Can't get it to work.  Tried

(.*);(.*)
(.*?);(.*)

and many variations.

Testing against the string "one;two;three"
should return a group "one" and subsequent group "two;three"

an expression that works would be much appreciated.

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


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


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