lua-patterns icon indicating copy to clipboard operation
lua-patterns copied to clipboard

Suggestion: render railroad diagrams?

Open sbrl opened this issue 3 years ago • 3 comments

This tool looks really cool! It reminds me of https://regexper.com/ (which is also open-source) - so I thought I'd suggest a railroad diagram, so it would make complex patterns easier to quickly understand :-)

sbrl avatar Jan 06 '22 01:01 sbrl

Hi, how do you imagine this diagram for a pattern?

GitSparTV avatar Jan 06 '22 05:01 GitSparTV

Let's consider the following pattern for example: [abc]%s*d?. It might look a bit like this:

image

(image taken from regexper.com by translating the above lua pattern into regular expression).

sbrl avatar Jan 16 '22 02:01 sbrl

Oof, that definitely needs some js library, I have no clue how to implement this yet

GitSparTV avatar Jan 16 '22 10:01 GitSparTV