in reply to Regular Expresson How to Match
Let me get this straight:
You're trying to match | br_summer and expect the output to have all the extra whitespace removed? Presuming this is a typo, not an expectation, your regex is incorrect. The pipe symbol is meaningful in a regexp,so it must be escaped, e.g.,
if($line =~ /^\|\s$str /){ print "Line is $line (with $str)\n"; }
Also, as a quibble, your regex won't match (even after the pipe symbol is escaped) if $str is followed by a non-blank whitespace character, e.g. a tab.
emc
|
|---|