javascript - Regular express to match `command--o1--o2--o3` -


i have string command--o1--o2--o3 ( command,o1,o2,o3 arbitrary words)

and want [o1, o2, o3] though regular expression(not array operation or other ways. use regular expression).

is there idea accomplish !?

if you're using javascript, , assuming want strings after --, may do

var things = str.split(/--/).slice(1) 

if want 2 characters words following --, may use

var things = str.match(/--\w\w/g).map(function(s){ return s.slice(2) }) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -