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


in reply to This looks like someone sneezed and hit the keyboard

I'm going to re-enter your RE as though it has the /x modifier so that it's easier to comment on what it's doing... here goes:

/ .* # Match any quantity of any character (or # none at all) ( # group together, and capture. [\$#\%>~] # match any one of the following: $#%>~ | # OR \@\w~\$ # match literal @, a word character, and $ | # OR \\\[\\e\[0m\\\] \[0m # match "\[\e[0m\] [0m" ) # end capturing / grouping. \s? # match a single optional whitespace /x # End regexp.

So you put that all together and you get a regexp that will match a pretty wierd looking string.

The following strings should match (and MANY others too):

"Hi, I'm Dave\[\e[0m\] [0m"

"121#@$14asdf$"

"@h~$"

Looks pretty peculiar to me.


Dave