Skip to content

Instantly share code, notes, and snippets.

@ccorcos
Created March 2, 2017 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccorcos/4a6e6f0047e75140574e27ea6c671f76 to your computer and use it in GitHub Desktop.
Save ccorcos/4a6e6f0047e75140574e27ea6c671f76 to your computer and use it in GitHub Desktop.
const here = between(
zeroOrMore(not(string('<here>'))),
between(
string('<here>'),
zeroOrMore(not(string('</here>'))),
string('</here>')
),
always()
)
here
.run('blah blah <here>hello world</here> blah')
.fold(
v => console.log('success', v.join('')),
e => console.log('error', e)
)
// => success hello world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment