regex - How can i express in regexp "match until a pattern without including that pattern"? -


i have input :

{http://sdfgdf.dfg.dfg.dfg#value1 : http://sdfgdf.dfg.dfg.dfg#value2} 

and i'd match value1 first url. thought below regexp :

[^#]\w*\s: 

but matches "value1 :"

how can express "match until \s: ,without including pattern?

zero-width lookahead. in java this:

[^#]\w*(?=\s:) 

you may think making regex more flexible, handle whitespaces , such... in case input different expect.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -