An alternative to regular expressions / regex

4 janaKal12 2 7/14/2025, 7:47:56 AM github.com ↗

Comments (2)

janaKal12 · 7h ago
If you don't like them: a complete alternative to regular expressions would be Scripal. It's fast and has a very intuitive syntax with short keywords. Scripal can interpret numbers directly, uses templates, look for files, knows comments, compare phrases for similarity and much more.
Someone · 5h ago
“a very intuitive syntax”

I disagree. Even the simple examples already have baffling aspects to me.

> match number ranges: match [1,200]

OK.

> match find (int[380,1400])

Hm. I guess the first one also matches floats? If so, does it match “Inf” and “NaN”? If not, what’s the difference with match[380,400]?

> match IPv4

> match ( pure[0,255] '.' pure[0,255] '.' pure[0,255] '.' pure[0,255] )

What’s the intuitive meaning of pure here? And what’s the difference between int[0,255] and pure[0,255]?

From the examples (https://github.com/scripal-git/scripal/blob/main/docs/Exampl...):

  match ( '678' )
  ifMatch { match ( isNumber[900,999]( digit digit digit ) '-' digit );}
So, what’s the intuitive difference between int[900,999] and isNumber[900,999]?