Update: (A little explanation at Moriarty's suggestion.) That's a zero-width positive look-ahead assertion. In other words, it splits the string right before "Wnr:" without losing any characters. I can't tell from the OP whether a trailing space should be kept on $string1. (The example doesn't include the ending double quote.) If you want to remove that space, you could put a literal space (or, better, \x20) before the opening paren. You could also use \s or \s+ there, depending on the behavior you need.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: split string on key word
by sauoq
in thread split string on key word
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |