Hacker News new | ask | show | jobs
by nmz 44 days ago
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.