var cache="__/v1/abc/abcd/?lat=40.12323&lon=2.1342&radius=1&x=gdfgdf";
if(cache.match(/lat=([-+]?\d+\.\d+)&lon=([-+]?\d+\.\d+)/))
{
// Your Code Match
}
else
{
// Your Code On Not Match
}
How to compare parameter pattern to URL parameters by native JavaScript?
-
14-10-2022 - |
質問
How to compare parameter pattern to URL parameters by native JavaScript?
For example my cache value is __/v1/abc/abcd/?lat=40.12323&lon=2.1342&radius=1&x=gdfgdf
I'd like to compare this regex pattern lat=[*]&lon=[*]&radius=[*]
to above cache value:
Does my cache include this challenge?
if (cache.regex(abovepattern)) {
}
解決
所属していません StackOverflow