I want to match all occurences of a word in a string having spaces at front and back.
Eg: String: " Apple Apple Apple Apple ".
Here I want the match to be " Apple " and there should be 4 matches for the above scenario.
If I just put regex as / Apple /, then only 1st and 3rd are matched.
I know that we can do this with lookahead and lookbehind in regex but it is not supported in safari and IE.
gmodifier is what you're looking for.Applewere not mistakes.gmodifier doesn't ensure this.