javascript - How to extract a text using regex? -


my text

1618148163#@#jasser-pc#-#1125015374#@#anas kayyat#-#1543243035#@#anas kayyat#-# 

result should be:

jasser-pc anas kayyat anas kayyat 

i using :

(?<=#@#)(.+)(?=#-#) 

but gives me :

jasser-pc#-#1125015374#@#anas kayyat#-#1543243035#@#anas kayyat 

javascript’s regular expressions don’t support look-behind assertions (i.e. (?<=…) , (?<!…)), can’t use regular expression. can use this:

#@#(.+)(?=#-#) 

then take matched string of first group. additionally, match little possible, make + quantifier non-greedy using +?.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -