Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

Provide Lua bindings for regular expressions #213

Open Khubajsn opened 10 years ago

Khubajsn commented 10 years ago

I know there's string.find, but it has some limitations. While there's always a workaround, an ability to use regular expressions would be really neat and often timesaving. I guess you could just put in one of the existing libraries if you didn't want to code this yourself.

UnderscoreKilburn commented 10 years ago

What are the limitations? Lua regexps are already quite complete, I don't see what else you'd need.

Pugsworth commented 10 years ago

Lua patterns are very limited if you want to do more complex search/matches.

Some Lua pattern limitations: Only single letters can match multiple of or repeated. ( te(st|xt) or (te[^s]t)+ fails) Optional groups don't exist. ( (%w)? fails ) Lookaheads or lookbehinds don't exist.

These are only a couple that I can remember off the top of my head.

Cheatoid commented 2 years ago

BUMP.