Skip to content

why does \b differ in behavior from other regex engines such as Swift's? #1092

Answered by BurntSushi
TOETOE55 asked this question in Q&A
Discussion options

You must be logged in to vote

It's unclear exactly what you're asking, but I took a stab at it by renaming the issue title to the question I think you're asking.

This crate defines \b as a Unicode word boundary. It is documented in the section on syntax. In short, it matches any position where there is a \w on one side and \W (or the beginning/end of a string) on the other. This is further documented in UNICODE.md, which specifically links to UTS #18 RL1.4. So in short, this crate defines \b as a "simple Unicode word boundary" according to the Unicode Technical Standard on regular expressions.

As for Swift, I went to its documentation page for regex and... found absolutely nothing about its supported syntax. Looking a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TOETOE55
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1091 on September 25, 2023 11:27.