FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

VerbalExpressions

CFMLVerbalExpressions

travis master status travis development status

CFMLVerbalExpressions is a CFML library that helps to construct hard regular expressions;

var regex = new VerbalExpression();

regex.startOfLine()
     .then('http')
     .maybe('s')
     .then('://')
     .maybe('www.')
     .anythingBut(' ')
     .endOfLine();

if (regex.test('https://github.com/')) {
    writeOutput('Valid URL');
} else {
    writeOutput('Invalid URL');
}

if (REFindNoCase(regex.toRegex(), 'https://github.com/') > 0) {
    writeOutput('Valid URL');
} else {
    writeOutput('Invalid URL');
}

Other Implementations

You can see other ports on VerbalExpressions.github.io.

Installation

Easiest way to install is through CommandBox:

box install VerbalExpressions

Tests

Run the tests by starting up a server and navigating to /tests/runner.cfm.

box server start port=9999
open http://localhost:9999/tests/runner.cfm

Contributing

This port of Verbal Expressions is not feature complete. Please see here for the list of required methods and submit pull requests (with tests) to add additional functionality.

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Download
1.0.0 Jan 14 2016 12:20 PM Jun 09 2016 12:10 PM Eric Peterson (elpete)

 

No collaborators yet.
 
5.00 / 1
  • Jan 14 2016 12:20 PM
  • Jun 09 2016 12:10 PM
  • 1189
  • 698
  • 1