[ACCEPTED]-Regex to match not start of line-regex
Most likely you can do this using lookbehind:
[^<]+ = one or more characters that are not <
< = the 1 < you're looking for
The dot '.' means "any value"
Anyway, I suppose 1 you don't want whitespaces, either. If so, then
This would give you "<" after the first 1 instance:
@duncan's method works fine if you just 9 want to replacing, but it doesn't match 8 the
But lookahead will work 3 here, which is:
will match the
< which is 2 not at the begining of a line.
and the replacing 1 will be:
'<list message="2 < 3">'.replace(/(?!^)</, '<')
More Related questions