Quantcast
Channel: What is a word boundary in regex? - Stack Overflow
Viewing all articles
Browse latest Browse all 14

Answer by tchrist for What is a word boundary in regex?

$
0
0

I talk about what \b-style regex boundaries actually are here.

The short story is that they’re conditional. Their behavior depends on what they’re next to.

# same as using a \b before:(?(?=\w) (?<!\w)  | (?<!\W) )# same as using a \b after:(?(?<=\w) (?!\w)  | (?!\W)  )

Sometimes that isn’t what you want. See my other answer for elaboration.


Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>