JavaScript: Search string from position
JavaScript has two useful methods, both which nearly do what I need.
String.prototype.indexOf()will search for a substring and return its position. It has an optionalpositionparameter which is the starting point of the search, so you can easily find the next one.String.prototype.search()will search a string using a regular expression and return its position. However, as far as I can tell, it doesn’t allow a starting position, so it always searches from the start.
Is there anything which allows me to find the position using a regular expression which does allow for a starting position?