I have a url that contains two values, a keyword and a location name. The keyword comes after the '/r/' and the location after the '/l/'.
E.g: localhost:3000/search/r/keyword/l/location
To get only the value after the '/r/' (keyword) and the value after the '/l/' (location); I'm doing the following Regexr:
var cutResult = window.location.href.match(/\br\/\b(\b[^\/]+\b)/gi);
var cutLocation = window.location.href.match(/\b\/l\/\b(\b[^\/]+\b)/gi);
This does the trick, however, React returns following message:
Unnecessary escape character: / no-useless-escape
What causes the error?