Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for possessive quantifiers #13

Open
MasseGuillaume opened this issue Jan 20, 2018 · 0 comments
Open

Add support for possessive quantifiers #13

MasseGuillaume opened this issue Jan 20, 2018 · 0 comments
Labels

Comments

@MasseGuillaume
Copy link
Contributor

// zero or one, prefer more
pass("X?+", "")
pass("X?+", "X")
find(".?+X", "X", pass = false)

// zero or more, prefer more
pass("X*+", "")
pass("X*+", "XXX")
find(".?+X", "X", pass = false)

// one or more, prefer more
fail("X++", "")
pass("X++", "XXX")

// exactly n
pass("X{3}+", "XXX")
fail("^X{3}+$", "XXXX")

// n or more, prefer more
pass("^X{3,}+$", "XXXX")
fail("^X{3,}+$", "XX")

// [n, m], prefer more
fail("^X{3,5}+$", "XX")
pass("^X{3,5}+$", "XXX")
pass("^X{3,5}+$", "XXXX")
pass("^X{3,5}+$", "XXXXX")
fail("^X{3,5}+$", "XXXXXX")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant