Match regex with any word in between 2 specific words -


i want use regex in atom editor terms such "export data as" or "export contract as". pretty "export ____ as" pattern have:

/^(export)" "[a-z]*" "(as)$/

but it's not working when tested in javascript console.

if literally want match "export data as" , not " export data " should use /export [a-za-z]+ as/ otherwise should use / export [a-za-z]+ / or if want match strings such "export data as" add i end so: /export [a-za-z]+ as/i or if using javascript, added post, want: var regex = new regexp("export [a-za-z]+ as", "i"); if doesn't answer question should try regexes using http://regexr.com/ or rules regex on https://developer.mozilla.org/en-us/docs/web/javascript/guide/regular_expressions.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -