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

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -