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

Regex Library #435

Open
Sainan opened this issue Nov 16, 2023 · 0 comments · May be fixed by #767
Open

Regex Library #435

Sainan opened this issue Nov 16, 2023 · 0 comments · May be fixed by #767
Labels
enhancement New feature or request

Comments

@Sainan
Copy link
Collaborator

Sainan commented Nov 16, 2023

local regex = require "pluto:regex"
local pattern = new regex [[/the (only )?one/i]])
print(pattern:matchesFully("THE ONE"))

pattern = new regex [[/anywhere from (\d+) to (\d+)/]]
local match = pattern:match("anywhere from 3 to 5")
-- 'match' would be nil if doesn't match, or a table with fields for each capture group (0 being the whole match, 1 and up being regular capturing groups, and string indecies for named capturing groups.)
@Sainan Sainan added the enhancement New feature or request label Nov 16, 2023
@Sainan Sainan linked a pull request Mar 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant