Asking for review on non-string regular expressions

Rémy 🤖 - Jul 26 '19 - - Dev Community

There is this idea I have and that I want to push forward about "non-string regular expressions". I explained things as I could on the repo.

GitHub logo Xowap / nsre

Non-String Regular Expressions

Non-String Regular Expressions

Build Status

NSRE (Non-String Regular Expressions) is a new spin at regular expressions It's really abstract, even compared to regular expressions as you know them but it's also pretty powerful for some uses.

Here's the twist: what if regular expressions could, instead of matching just character strings, match any sequence of anything?

from nsre import *

re = RegExp.from_ast(seq('hello, ') + (seq('foo') | seq('bar')))
assert re.match('hello, foo')
Enter fullscreen mode Exit fullscreen mode

The main goal here is matching NLU grammars when there is several possible interpretations of a single word, however there is a lot of other things that you could do. You just need to understand what NSRE is and apply it to something.

Note — This is inspired by this article from Russ Cox which explains how Thompson NFA work, except that I…

I'm looking for all kinds of feedbacks

  • Do you understand what this is?
  • Do you see applications for this?
  • Does the API look nice?
  • What features would you want to see around that?
  • What would you want before using this in production?

Thanks!

. . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player