What ccn said. If the thing to the right and left of the : need to be on the same line, use [^\S\n] instead of \s. Also, I think (.+?)? is a little on the obfuscated side. I would make from the : onward :[^\S\n]*(.*?)\s*$ (though I think that leaves
$2 blank instead of undef.) (The final \s can be left as is unless you want to prevent the regex from swallowing up blank lines.)
Comment on Re: Regex problem with .+ matching newlines without /s
(.+?)? resulted from my (possibly obfuscated) thought process.
[^\S\n] did the trick, thanks much. I rarely deal with multi-line matches and didn't know that about \s. Seems to me there ought to be an easier way to express non-newline whitespace than [^\S\n].
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.