Javascript RegEx - Start and End of String Anomalies -
So I'm trying to exclude some real benefits and I have been told that the beginning and end of the string .
In a way, ' \ A ' will be & amp; ' \ z ' and the other would be ' ^ ' & amp; ' $ '
For some reasons when it is running in JS, there is only one option that actually works.
Pattern2 = New RegExp ("\ A \\ d {6} \ Z"); If (pattern1.test (str)) {Warning ('Pattern 1 match!'); } And {warnings ('Pattern 1 no match!'); } If (pattern2.test (str)) {Warning ('Pattern Match 2!'); } And {warnings ('Pattern 2 is no match!'); } I think that nobody tells you that var str = "123456", pattern 1 = new RegExp ("^ \ \ d \ 6 $ $"), does anyone know why this could happen? \ A < / Code> and \ z should have worked incorrectly Based on, only ^ and $ should work.
Comments
Post a Comment