Jan 29, 2014, 9:51 AM
Post #2 of 3
It depends on where you use them. The valid places are single quoted strings, double quoted strings, or regular expressions.
Re: [Ram.bm] differnce between \b
[In reply to]
$string = qq/pattern\b/; # backspace character
$string = q/pattern\b/; # backslash followed by letter b
$regex = qr/pattern\b/; # match a word boundary
$string = qq/pattern\b+/; # backspace and a +
$string = q/pattern\b+/; # backslash, b, and +.
$regex = qr/pattern\b+/; # Not sure.
Parentheses do not change the meaning of the \b.
Brackets do not change the meaning of the \b in a string.
Brackets in a regex define a character class.
Characters within the class have the same meaning as in double quoted strings.