http://www.perlmonks.org?node_id=1028330


in reply to Need A regex

See this recently posted reply to Regex Modification. It may be helpful. But in any event, CountZero's approach above seems both simple and effective.

Update: This reply is a later and better version of the reply linked above.