firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.2k stars 198 forks source link

Lua pattern matching flavor #70

Open Gethe opened 9 years ago

Gethe commented 9 years ago

I would love to see support for Lua on this site. http://www.lua.org/pil/20.1.html

firasdib commented 9 years ago

Lua regex is unfortunately too different and would require a great change in existing code as it stands right now. Maybe in the future, but it is unfortunately not very likely unless I decide to do a massive rehaul. I wonder why lua went with the syntax that they did..

Kruithne commented 7 years ago

It's been two years since this request and we've seen quite a bit of change to the site. Any chance that the possibility of adding support for Lua could be re-visited? :+1:

firasdib commented 7 years ago

That depends on what regex engine lua uses, if it can be emulated with the existing ones or have its own ported to JS. Is there a complete link to the spec sheet?

Kruithne commented 7 years ago

I'm not sure if there's a full spec floating around, as the Lua documentation is very lax in general, but there's a reference here: https://www.lua.org/pil/20.2.html

TWiStErRob commented 7 years ago

It looks really simple, other than those weird percents it looks quite similar to normal regex.

@firasdib You asked above why they did it, they say in the docs that it's because the POSIX implementation is too long and theirs is just quarter of that in length.

firasdib commented 7 years ago

We could potentially implement Lua as a shim on top of PCRE, since it looks like its a subset of PCRE anyway.

X-Raym commented 6 years ago

This would be nice !

EntranceJew commented 5 years ago

I think this would be a great addition, as I often find myself backporting PCRE expressions I made on the site to Lua and banging my head on the discrepancies.

Doqnach commented 5 years ago

do you have a short-list of stuff you often run in to?

joshenders commented 3 years ago

Any interest in restarting this discussion? I adore regex101 and Lua. I'll put $100 donation reward on this feature getting merged.

firasdib commented 3 years ago

@joshenders I think this is too much work as of right now, unfortunately. Ideally I'd like to get C# working first.

lucamauri commented 2 years ago

@joshenders I think this is too much work as of right now, unfortunately. Ideally I'd like to get C# working first.

Now that the C# is done, any chance you will work on LUA? I recently started working heavily on Mediawiki and Wikibase: LUA is their scripting language of choice (via Scribunto) and it would be great to apply the power of Regex101 to it.

Thanks for your effort

speedwaystar commented 1 year ago

i'd certainly like to see this added.

dsully commented 1 year ago

💯

InSyncWithFoo commented 10 months ago

Lua patterns have some interesting features of their own:

However, their quirks far outweight the features: Lua is not very internationalized by design. Lua patterns match by bytes and metasequences like %a (letters) are only ASCII-aware. For example, ('Á'):match('%a') returns nil whereas ('Á'):match('%A') returns the first byte. If Lua patterns were to be added to the bunch, these will need to be fully addressed.

DeznekCZ commented 1 month ago

Ten years passed, is there any update of this topic?

joshenders commented 1 month ago

I am still interested as well. This is such a wonderful tool! Thank you.

alreadypro commented 1 month ago

Would be nice to have this feature