Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex higher IR library
#1
Before I delve into making my own module, I was wondering if there already exists a regex higher IR (intermediary representation) of regex tokens for python
I can import the actual regex parser from re like:
from re._parse import parse

parse("reg|ex")
and it gives an output like
Output:
[(BRANCH, (None, [[(LITERAL, 114), (LITERAL, 101), (LITERAL, 103)], [(LITERAL, 101), (LITERAL, 120)]]))]
but it's not in a very useful format for doing other stuff with. Similar libraries exist in Rust regex_syntax::hir or JS's regexp-tree.
For python, I find searching for regex related projects online pretty difficult as most results end up being something along the lines of how to use re or regex in python, but I would be surprised if something like the other projects shown doesn't exist in python. It wouldn't need to support any advanced regex features like lookaheads, but just have a better way of representing regex tokens.

Does anyone know of a module like this?
Thanks,
Dream
Reply


Messages In This Thread
Regex higher IR library - by DreamingInsanity - Jun-04-2022, 11:37 PM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 05:46 AM
RE: Regex higher IR library - by DreamingInsanity - Jun-05-2022, 10:06 AM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 03:12 PM
RE: Regex higher IR library - by DreamingInsanity - Jun-05-2022, 04:07 PM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 06:21 PM
RE: Regex higher IR library - by DreamingInsanity - Jun-06-2022, 02:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner Higher Lower Game wallytan 2 1,670 Sep-29-2022, 05:14 PM
Last Post: deanhystad
  finding the next higher representable floating point value Skaperen 0 1,985 Sep-13-2019, 11:16 PM
Last Post: Skaperen
  the next higher character Skaperen 13 5,038 Jun-07-2019, 01:44 PM
Last Post: heiner55
  How do I loop through a list and delete numerical elements that are 1 lower/higher? neko 4 4,355 Sep-05-2017, 02:25 PM
Last Post: ichabod801
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,886 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

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