java - Regex how to get everything apart from the first character -


this string

username=john903?fullname=john&smith 

this regex far

=([^?]*) 

i trying capture "john903"

however returns "=john903"

javascript: (originally question tagged javascript)

the regex have captures value want, returns array. match without equal sign in second element of array:

var str = "username=john903?fullname=john&smith".match(/=([^?]*)/)[1]  //str "john903" 

java: (op commented in fact using java)

string line = "username=john903?fullname=john&smith"; pattern pattern = pattern.compile("=([^?]*)"); matcher matcher = pattern.matcher(line); system.out.println(matcher.group(1)); 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -