Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Interesting Idea: Stop writing Regular Expressions. Express them with Verbal Expressions. (VerbalExpressions turns the often-obscure-and-tricky-to-type regular expression operators into descriptive, chainable functions. )
Interesting Idea: Stop writing Regular Expressions. Express them with Verbal Expressions. [message #45027] Fri, 21 August 2015 14:55 Go to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Stop writing Regular Expressions. Express them with Verbal Expressions.

GitHub user jehna has fashioned a runaway hit with his unique way of constructing difficult regular expressions.

VerbalExpressions turns the often-obscure-and-tricky-to-type regular expression operators into descriptive, chainable functions. The result of this is quite astounding. Here's the example URL tester from the README:

VerEx tester = VerEx()
            .startOfLine()
            .then( "http" )
            .maybe( "s" )
            .then( "://" )
            .maybe( "www." )
            .anythingBut( " " )
            .endOfLine();

This style may be off-putting to old-school regex pros, but even they would have to admit that it's quite approachable and easy to reason about.

The main project is a JavaScript library, but in the world of open source the more success you have, the more ports you get.

VerbalExpressions has been ported to so many other languages that a GitHub organization was created just to host them all. I think this idea struck a real nerve.

Article links:
English: Stop writing Regular Expressions. Express them with Verbal Expressions.
Russian: Хватит писать регулярные выражения. Используйте вербальные выражения
GitHub C++ variant of lib: https://github.com/VerbalExpressions/CppVerbalExpressions


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
 
Read Message
Read Message
Previous Topic: Looking for windows compiler possibilities
Next Topic: Proposal: optional int64 size/indexes
Goto Forum:
  


Current Time: Sun Apr 28 00:15:59 CEST 2024

Total time taken to generate the page: 0.03396 seconds