Python Forum
trying to recall a regex for re.split()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to recall a regex for re.split()
#23
(May-19-2022, 10:40 PM)Skaperen Wrote: is there a tool to create that which i could use (Python 3.6,Ubuntu 18.04, Firefox 100)?
I created the image by using a tool named jsyntrax. Unfortunately, it does not parse the regular expression, so I had to write my interpretation of the regular expression in a .spec file
indentstack(
    10,
    line(
        opt(choice('+', '-')),
        loop(None, ' '),
        choice(
            line(
                loop('0-9', None),
                opt(line('.', loop(None, '0-9')))),
            line('.', loop('0-9', None)))),
    opt(
        line(
            choice('e','E'),
            opt(choice('+', '-')),
            loop('0-9', None))))
jsyntrax runs on java. The only thing to do is to dowload the zip file, uncompress and run. There is also a Python syntrax module on pypi, but it seems abandoned by the author who switched to Java because of multiplatform concerns. I had an exception while trying to use Python's syntrax module. I don't want this module to die, I think I'm going to fork my own version.

It should not be too difficult to write a regex parser to convert a regular expression to such a diagram. I have already used Syntrax for a parsing project and it worked well. Perhaps I'll do it when I find some time to do so.
Reply


Messages In This Thread
RE: trying to recall a regex for re.split() - by Gribouillis - May-20-2022, 10:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Split pdf in pypdf based upon file regex standenman 1 2,308 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B
  recall cool_person 1 1,106 May-07-2022, 08:04 AM
Last Post: menator01

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020