in reply to Split operator in perl
Using a quantifier (+,*,?,{m,n}) on a capture rarely makes sense. If you didn't want to capture: /(?:a|b)+/ or /[ab]+/. If you wanted to capture the whole separator: /((?:a|b)+)/ or /([ab]+)/.
Then there's the fact that your separator is probably not really a separator since one a matching pattern is found at the start of the string. This will cause you to have a leading empty field.
What are you expecting for output?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split operator in perl
by binesh_28 (Initiate) on Dec 06, 2010 at 07:58 UTC | |
by ikegami (Patriarch) on Dec 06, 2010 at 16:23 UTC |