regex - jQuery get substring from string having start and end substrings of substring -


so have string, lets one:

the quick brown fox jumps on lazy dog

and lets there jumping animal, not fox, string different. , need part of it, lets one

brown fox jumps

i know string starts "brown" , ends "jumps" suppose need regex solve this.

i thankful if explain structure of writing regex me, because far don't it.

just select word in between easiest one.

/(brown.*jumps)/i 

regular expression visualization

regex tester

or if select animal single word too:

/(brown (.*) jumps)/i 

regular expression visualization

regex tester


Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

android - How to read a column value in parse.com without accessing an object or a pointer -

timer - Java TimerTask cancel -