A word boundary, in most regex dialects, is a position between \w
and \W
(non-word char), or at the beginning or end of a string if it begins or ends (respectively) with a word character ([0-9A-Za-z_]
).
So, in the string "-12"
, it would match before the 1 or after the 2. The dash is not a word character.
Related Contents:
- Regex match entire words only
- Oracle REGEXP_LIKE and word boundaries
- PostgreSQL Regex Word Boundaries?
- Using regular expressions to parse HTML: why not?
- Why is this regex allowing a caret?
- Using regular expressions to validate a numeric range
- How to negate specific word in regex? [duplicate]
- How can I match “anything up until this sequence of characters” in a regular expression?
- How can we match a^n b^n?
- Parsing scientific notation sensibly?
- Collapse and Capture a Repeating Pattern in a Single Regex Expression
- What is “The Best” U.S. Currency RegEx?
- Match two strings in one line with grep
- Regex match one of two words
- How does the regular expression ‘(?
- Using alternation or character class for single character matching?
- Match linebreaks – \n or \r\n?
- Regex lookahead for ‘not followed by’ in grep
- Regex AND operator
- Verbs that act after backtracking and failure
- How can I make my match non greedy in vim?
- Is it possible for a computer to “learn” a regular expression by user-provided examples?
- Regular expressions in a Bash case statement
- What does ?! mean?
- Regular Expression Word Boundary and Special Characters
- How to extract string following a pattern with grep, regex or perl [duplicate]
- How to define a regex-matched string type in Typescript?
- How can I use a variable in the replacement side of the Perl substitution operator?
- Regex to find repeating numbers
- R – gsub replacing backslashes
- How to match all text between two strings multiline
- Regex matching in a Bash if statement
- Regex pattern for HH:MM:SS time string
- Regex not operator
- How do I find and remove duplicate lines from a file using Regular Expressions? [closed]
- Deprecated: Function split() is deprecated. How to rewrite this statement?
- Can’t escape the backslash in a regular expression?
- Oracle 11g get all matched occurrences by a regular expression
- Lookbehind on regex for VBA?
- How to replace a whole line with sed?
- .htaccess RewriteRule to path without changing URL
- htaccess 301 redirect – Remove query string (QSA)
- Grammatical inference of regular expressions for given finite list of representative strings?
- Extracting text after last period in string [duplicate]
- regex to remove ordinals
- US Phone Number Verification
- What do \S, \W, \D stand for in regex?
- Remove duplicates from text file based on second text file
- Bash – Regex for HTML contents
- Using sed and grep/egrep to search and replace