in reply to Help perlifying this string parse-o-rama
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
|
|---|