Relatively straight forward:
$s = "firstfield second field KNOWNWORD alwaysOneWord then one or more + make the last field";; @fields = $s =~ m[(\S+)\s(.+)\sKNOWNWORD\s(\S+)\s(.+)];; print join '|', @fields;; firstfield|second field|alwaysOneWord|then one or more make the last f +ield
In reply to Re: Help perlifying this string parse-o-rama
by BrowserUk
in thread Help perlifying this string parse-o-rama
by balt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |