- Ported from VerbalExpressions
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');
}You can see other ports on VerbalExpressions.github.io.
Easiest way to install is through CommandBox:
box install VerbalExpressionsRun the tests by starting up a server and navigating to /tests/runner.cfm.
box server start port=9999
open http://localhost:9999/tests/runner.cfmThis 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.