Let's say I have the following string:
str = "http://www.google.com/joao.pedro?a=b";
So I want to get just john.pedro using JavaScript .
I think you can do with Regex somehow, can anyone help me how?
I thought of something like, use this regular expression:
(http://www.google.com/)([\d\w\.]+)
And get the value that would be between the second parentheses. In PHP you can do something like this using the preg_match
function, but what about JavaScript?