JSFiddle - React, Tailwind, and code Playground
JavaScript
var s = '#/search/sport';
if (s.match(/\#\/search/)) {
console.log('search');
}
var s = '#/search/sport';
if (s.match(/\#\/search/)) {
console.log('search');
}