Skip to content

How to match all word pairs (with overlap/look-behind)? #2189

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

You must be logged in to vote

It seems to me like if you want all word pairs, then you necessarily must also have the ability for matches to overlap. PCRE almost seems like it could give you that with look-around, but look-around doesn't actually change the bounds of the match itself. Overlapping matches are typically not supported by most general purpose regex engines.

Despite my heavy involvement in implementing regex engines, I am not particularly creative in their use and haven't spent a lot of time with PCRE features. So I think either someone else will need to answer this (if there's even a solution) or this question would probably be better asked somewhere where there are more PCRE folks.


I am working on addin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kenorb
Comment options

You must be logged in to vote
0 replies
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