4 ms·
Stop writing URLs as strings. Express them with VerbalResourceLocator: var vrl = VRL(). schema("https"). tld("com"). sld("ycombinator"). subd
by antichaos 13y ago
Stop writing URLs as strings. Express them with VerbalResourceLocator:
var vrl = VRL().
schema("https").
tld("com").
sld("ycombinator").
subdomain("news").
path("/item").
query({"id": "6164276"});
Seriously though, Verbal Expression is a great way to turn terse regexps into un-reusable verbiage that barely improves readability.
- rtpg 13y agoSpeak for yourself, this is a lot clearer for me. I'm used to navigating grammars, but I can't deal with regex (way too terse). Especially when I'm not just matching, but I want to extract info. Some verbosity can go a long way to making things clearer. Don't know if this is the solution I'm looking for though
- gojomo 13y agoIf the terse run-together-ness of usual regexes is unclear, you may also want to look into 'freespace' formatting... which lets you insert insignificant whitespace to break the regex into logical groups/lines, and even add inline comments: http://www.regular-expressions.info/freespacing.html http://www.regular-expressions.info/freespacing.html