Javascript regex match (random string in the middle) -
i want test if string can match pattern in javascript
problem there random string in middle pattern: "account/os/some_random_string/call_back"
so string below match
var mystring = "account/os/1234567/call_back"
thanks
you want regex starts account/os/
, ends /call_back
, here's one:
/^account\/os\/.*\/call_back$/
.*
match random string (including empty string.). if want minimum length on random string change *
:
.* : 0 or more characters .+ : 1 or more characters .{n,} : n or more characters (replace n actual number)
Comments
Post a Comment