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
Post a Comment