How to match the first word after an expression with regex?

This sounds like a job for lookbehinds, though you should be aware that not all regex flavors support them. In your example: (?<=\bipsum\s)(\w+) This will match any sequence of letter characters which follows “ipsum” as a whole word followed by a space. It does not match “ipsum” itself, you don’t need to worry about reinserting … Read more

Oracle REGEXP_LIKE and word boundaries

I believe you want to try select 1 from dual where regexp_like (‘does test work here’, ‘(^|\s)test(\s|$)’); because the \b does not appear on this list: Perl-influenced Extensions in Oracle Regular Expressions The \s makes sure that test starts and ends in a whitespace. This is not sufficient, however, since the string test could also … Read more

What are non-word boundary in regex (\B), compared to word-boundary?

A word boundary (\b) is a zero width match that can match: Between a word character (\w) and a non-word character (\W) or Between a word character and the start or end of the string. In Javascript the definition of \w is [A-Za-z0-9_] and \W is anything else. The negated version of \b, written \B, … Read more

What is a word boundary in regex?

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 … Read more