A long time ago, I took a look at using boundary , studying about regular expressions in PHP (PCRE Patterns).
I came across the \b
(which is called boundary).
How useful is it in a regular expression?
A long time ago, I took a look at using boundary , studying about regular expressions in PHP (PCRE Patterns).
I came across the \b
(which is called boundary).
How useful is it in a regular expression?
The \b
(beta) is an anchor as well as its ^
(alpha) and $
(omega) primes. Once added on one side of the regex will capture pattern specified at the beginning, end or exact , that means that it is valid only for letters, numbers and the underline (% with_%) which is the equivalent to [A-Za-z0-9_]
.
Entry:
dialogo dia melodia diafragma dialeto radial bom-dia
Collapse at the beginning \w
capture strings that contain at the beginning (not the beginning of the line ) the default \bdia
, the items that enter the capture are, day logo, day , day fragma, strong> leto and bom- day
Anchor at the end dia
captures strings (words) where the specified pattern is at the end, the captured items are: day , day and day
Extent anchor dia\b
captures strings day and good - day
References