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

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -