With the string http://stackoverflow.com/questions/ask?hello=world, you can use /^.+\?/ to capture http://stackoverflow.com/questions/ask?. How can I just capture http://stackoverflow.com/questions/ask.
With the string http://stackoverflow.com/questions/ask?hello=world , you can use /^.+\?/ to capture http://stackoverflow.com/questions/ask? . How
Share
You can use
^[^?]+This will capture until a question mark is found, but the question mark will not be in the result.
Check it out.