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 lookaheads #12

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

Add support for lookaheads #12

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

Comments

@MasseGuillaume
Copy link
Contributor

// positive lookahead
passAndFail(".*\\.(?=log$).*$", "a.b.c.log", "a.b.c.log.")

// negative lookahead
passAndFail(".*\\.(?!log$).*$", "abc.logg", "abc.log")

// positive lookbehind
passAndFail(".*(?<=abc)\\.log$", "abc.log", "cde.log")

// negative lookbehind
passAndFail(".*(?<!abc)\\.log$", "cde.log", "abc.log")

// atomic group
pass("(?>a*)abb", "aaabb")
pass("(?>a*)bb", "aaabb")
pass("(?>a|aa)aabb", "aaabb")
pass("(?>aa|a)aabb", "aaabb")

// quantifiers over look ahead
passAndFail(".*(?<=abc)*\\.log$", "cde.log", "cde.log")
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