the if-statement is true if $check="foo-bar doo" and it's also true if $check="bar doo" I need it to match 'foo-bar doo' only, not 'bar doo'. Is there a possibility to include '-' into /b? Or should I do it another way? Thanks in advance! Lynn$string_to_check="yyy foo-bar doo zzz"; if ($string_to_check =~ /\b$check\b/) { ... }
In reply to Word boundary in regexp by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |