I have this input :
{http://sdfgdf.dfg.dfg.dfg#value1 : http://sdfgdf.dfg.dfg.dfg#value2}
and i’d like to match only the value1 from the first URL.
I thought the below regexp :
[^#]\w*\s:
but this matches “value1 :”
How can i express “match until \s: ,without including that pattern?
Zero-width lookahead. In Java you could do it like this:
You may think about making this regex more flexible, to handle extra whitespaces and such… just in case the input is just slightly different from what you expect.