in javascript i tried to read window.location.search. the value of this variable may be something like ?ref=somestring&read=1or ?read=1&ref=sometringor just ?ref=somestring.
How to extract from a variable only ref=somestring?
so far I have tried the following regex:
ref.match(/ref=([^\&].*)\&/)
ref.match(/ref=([^\&].*)\&/)
ref.match(/ref=([^\&].*)\&?/)
ref.match(/ref=([^\&].*)\&?/)
source
share