I find RegEx's a bit cryptic. Sure, with enough practice one can read them, but I'd like an alternative that can easily break out chunks as named units. One can then reference the named units to compose new named units. Divide-and-Conquer. I'd like to see experiments in alternatives that provide this. It could help do for RegEx's what SQL's WITH statement did for long SQL statements. Backus–Naur Form could act as a s…
RegExr
41–50 of 57 posts
Re: RegExr
#42I prefer regex101.com because that site assigns different colors to different capture groupings. I made a previous comment on this and why it's helpful: https://news.ycombinator.com/item?id=9581692 (For some reason RegExr.com is submitted to HN much more often than regex101.com. Is there a compelling advantage to RegExr that I've overlooked?)
regexr is open source, unlike regex101.
Re: RegExr
#43My favorite is https://regex101.com/ But I've found all of the following to be useful: http://regexone.com/ http://www.regexpal.com/ http://www.rexegg.com/ http://regexr.com/ https://www.debuggex.com/ https://regexper.com/ https://www.regular-expressions.info/ http://www.cheatography.com/davechild/cheat-sheets/regular-e... http://eloquentjavascript.net/09_regexp.html http://www.smashingmagazine.com/2009/06/essential-…
Thanks for the list, but are they all the same? Why go to one over the other?
Re: RegExr
#44My favorite is https://regex101.com/ But I've found all of the following to be useful: http://regexone.com/ http://www.regexpal.com/ http://www.rexegg.com/ http://regexr.com/ https://www.debuggex.com/ https://regexper.com/ https://www.regular-expressions.info/ http://www.cheatography.com/davechild/cheat-sheets/regular-e... http://eloquentjavascript.net/09_regexp.html http://www.smashingmagazine.com/2009/06/essential-…
Re: RegExr
#45I find RegEx's a bit cryptic. Sure, with enough practice one can read them, but I'd like an alternative that can easily break out chunks as named units. One can then reference the named units to compose new named units. Divide-and-Conquer. I'd like to see experiments in alternatives that provide this. It could help do for RegEx's what SQL's WITH statement did for long SQL statements. Backus–Naur Form could act as a s…
See for example Peg.js, LPEG (lua), etc. However, PEGs don't natively permit left recursion (note: some PEG implementations do add that on). If that's a problem, Earley parsers are a nice alternative.
Example of a calculator using Peg.js:
start
= additive
additive
= left:multiplicative "+" right:additive { return left + right; }
/ multiplicative
multiplicative
= left:primary "*" right:multiplicative { return left * right; }
/ primary
primary
= integer
/ "(" additive:additive ")" { return additive; }
integer "integer"
= digits:[0-9]+ { return parseInt(digits.join(""), 10); }Re: RegExr
#46This is nice, but my go to tool is: https://www.debuggex.com/ Not only does it tell you what everything means, but it visually displays it in a way that just makes sense.
Re: RegExr
#47Re: RegExr
#48Re: RegExr
#49My favorite is https://regex101.com/ But I've found all of the following to be useful: http://regexone.com/ http://www.regexpal.com/ http://www.rexegg.com/ http://regexr.com/ https://www.debuggex.com/ https://regexper.com/ https://www.regular-expressions.info/ http://www.cheatography.com/davechild/cheat-sheets/regular-e... http://eloquentjavascript.net/09_regexp.html http://www.smashingmagazine.com/2009/06/essential-…
https://ia902309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoI...
Re: RegExr
#50My favorite is https://regex101.com/ But I've found all of the following to be useful: http://regexone.com/ http://www.regexpal.com/ http://www.rexegg.com/ http://regexr.com/ https://www.debuggex.com/ https://regexper.com/ https://www.regular-expressions.info/ http://www.cheatography.com/davechild/cheat-sheets/regular-e... http://eloquentjavascript.net/09_regexp.html http://www.smashingmagazine.com/2009/06/essential-…