News for hackers. Stuff that matters.
Re:Best syntax for a regex literal by vonox on Tuesday January 29, 2019 @02:12PM (#19029023)
Thanks
Re:Best syntax for a regex literal by vonox on Tuesday January 29, 2019 @02:14PM (#19029033)
I also use an alternative regex syntax to improve readability. For example:

re ("abc" | ["0"-"9"]+)

means this:

/abc|[0-9]+/

(You can put whitespaceses into the literal)

Re:Best syntax for a regex literal by ktpsns on Tuesday January 29, 2019 @04:12PM (#19029819)
PCRE have the /x modifier to allow whitespace and comments.

When reinventing the wheel, it's hard to top what other do already pretty well. Also, be warned people have to learn your syntax and this will probably stop them using it.