News for hackers. Stuff that matters.
Re:Stop writing Regular Expressions – Express them with Verb... by antichaos on Tuesday August 06, 2013 @12:34AM (#6164810)
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.
Re:Stop writing Regular Expressions – Express them with Verb... by rtpg on Tuesday August 06, 2013 @04:25AM (#6165432)
Speak 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

Re:Stop writing Regular Expressions – Express them with Verb... by gojomo on Tuesday August 06, 2013 @06:47AM (#6165816)
If 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

Re:Stop writing Regular Expressions – Express them with Verb... by gyepi on Monday August 05, 2013 @09:48PM (#6164400)
I had never heard of this before. The stated goal is to simplify difficult regular expressions, but the examples seem to be more complicated than the corresponding regexes. Maybe I'm just old school.

I'm not sure that someone who relies on this would be able to debug the resulting generated regex when something doesn't work as expected.

Re:Stop writing Regular Expressions – Express them with Verb... by kcorbitt on Monday August 05, 2013 @11:24PM (#6164627)
I agree that for someone who already has the skills to reason with regexes this has little to offer. But I'm not ready to count the idea out yet -- it's easy to underestimate the length to which people will go to avoid being forced to learn a new way to think. Easy string matching without regexes would have been extremely appealing to my just-starting-programming self.
Re:Stop writing Regular Expressions – Express them with Verb... by brudgers on Tuesday August 06, 2013 @12:31AM (#6164805)
As a language, Regex is somewhat opaque to most people these days.

Or a person wants to solve a simple problem by matching a simple string, so they decide to learn Regex. Now they have two problems, the second is learning to express what they want to do.

The problem this solves is casual use by people who don't match strings all day. There are tradeoffs - most of them are keystrokes. On the other hand for casual Regexers slowing down and unpacking the expression is probably useful.

Re:Stop writing Regular Expressions – Express them with Verb... by cleaver on Tuesday August 06, 2013 @12:23AM (#6164791)
I'm always a bit wary of posts that tell me to "Stop doing X". I'm also pretty comfortable with regular expressions. They take you outside of the procedural comfort zone, but are a valuable tool that will pay off to learn.

Still, it's worth a shot trying to create a tool like this. What I don't get is how they would handle subexpressions.

Re:Stop writing Regular Expressions – Express them with Verb... by stphnclysmth on Tuesday August 06, 2013 @12:05PM (#6167350)
Looking at the wiki, I don't think it does handle them. I reckon that if jehna when to the trouble of making this, he knows of at least one use case, even if it's his own. I appreciate that he's shared his work. That said, from my own experience, by the time a regular expression becomes difficult for me to parse, there are subexpressions, negative lookbehinds, and other less comprehensible regex features that this library doesn't seem to support.
Re:Stop writing Regular Expressions – Express them with Verb... by eru on Tuesday August 06, 2013 @12:52AM (#6164863)
With parentheses?
Re:Stop writing Regular Expressions – Express them with Verb... by keithgabryelski on Tuesday August 06, 2013 @12:16AM (#6164771)
when you pretend you aren't using regular expressions, then you have two problems.
Re:Stop writing Regular Expressions – Express them with Verb... by eurleif on Tuesday August 06, 2013 @12:44AM (#6164839)
pyparsing (http://pyparsing.wikispaces.com/) is more object-oriented and composable, and it can parse recursive grammars.
Re:Stop writing Regular Expressions – Express them with Verb... by eru on Tuesday August 06, 2013 @12:51AM (#6164861)
And of course there's also Parsec (http://research.microsoft.com/en-us/um/people/daan/download/...) for Haskell.
Re:Stop writing Regular Expressions – Express them with Verb... by FreakLegion on Tuesday August 06, 2013 @01:09AM (#6164916)
My first thought was that "Verbal Expressions" are simply parser combinators, which of course can do things that individual regular expressions can't do. From the examples though it looks like this is just translating to regular expressions under the hood, which would make it considerably less powerful than Parsec and other parser combinator libs.
Re:Stop writing Regular Expressions – Express them with Verb... by cgag on Tuesday August 06, 2013 @02:09AM (#6165059)
There's a great clojure parser combinator library inspired by parsec as well: https://github.com/blancas/kern
Re:Stop writing Regular Expressions – Express them with Verb... by grkovalev on Tuesday August 06, 2013 @01:05AM (#6164901)
What is news? it's LINQ just for string
Re:Stop writing Regular Expressions – Express them with Verb... by DavidSJ on Monday August 05, 2013 @11:26PM (#6164630)
Looks like cl-ppcre.