JS Verbal Expressions interactive documentation

The documentation is live and interactive powered by the klipse plugin:

  1. Live: The code is executed in your browser
  2. Interactive: You can modify the code and it is evaluated as you type

Setup

First let's load VerEx from the JSVerbalExpressions CDN.

Here is the JSVerbalExpressions Github repository.




VerEx.toString()

test RegExp

test matches a Regexp.


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

// Create an example URL
var testMe = 'https://www.google.com';

// Use RegExp object's native test() function
tester.test(testMe)

test RegExp

find and replace for string manipulation.


  
VerEx().find('red').replace('We have a red house', 'blue');