\B matches only if the pattern is contained in a word. : modifier « Regular Expression « Perl
- Perl
- Regular Expression
- modifier
\B matches only if the pattern is contained in a word.
/\Bdef/ matches abcdef, but not def.
/def\B/ matches defghi,
/\Bdef\B/ matches cdefg or abcdefghi
Related examples in the same category