I'm attempting to extract strings between occurences of a specific character in a larger string.
For example:
The initial string is:
var str = "http://www.google.com?hello?kitty?test";
I want to be able to store all of the substrings between the question marks as their own variables, such as "hello"
, "kitty"
and "test"
.
How would I target substrings between different indexes of a specific character using either JavaScript or Regular Expressions?