Comment

Comment by nmz

FWIW, lpeg is nice, of course you'll still have to deal with the terseness, but I don't think there's anything that can be done, since you will have to write an expression.

  patt <- country area "-" phone fin
  country <- ("+" %digit^-3 "-")?
  area <- %digit^3
  phone <- %digit^3 "-" %digit^4
  fin <- ! .
Not that impressive, but at least it doesn't group captures and groups and string escapes \ with a class labeling symbol.
parent nmz 15 days ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton