PostgreSQL Regex Word Boundaries? -
does postgresql support \b
?
i'm trying \bab\b
doesn't match anything, whereas (\w|^)ab(\w|$)
does. these 2 expressions same, aren't they?
postgresql uses \m
, \m
, \y
, \y
word boundaries:
\m matches @ beginning of word \m matches @ end of word \y matches @ beginning or end of word \y matches @ point not beginning or end of word
see regular expression constraint escapes in manual.
there [[:<:]]
, [[:>:]]
, match beginning , end of word. the manual:
there 2 special cases of bracket expressions: bracket expressions
[[:<:]]
,[[:>:]]
constraints, matching empty strings @ beginning , end of word respectively. word defined sequence of word characters neither preceded nor followed word characters. word character alnum character (as defined ctype) or underscore. extension, compatible not specified posix 1003.2, , should used caution in software intended portable other systems. constraint escapes described below preferable (they no more standard, easier type).
Comments
Post a Comment