Answers for "js string to regex"

2

js string to regex

const regex = new RegExp('https:\\/\\/\\w*\\.\\w*.*', 'g');
Posted by: Guest on September-18-2020
2

js match any number string

const match = 'some/path/123'.match(/\/(\d+)/)
const id = match[1] // '123'
Posted by: Guest on June-26-2020
9

regular expression javascript

// Tests website Regular Expression against document.location (current page url)
if (/^https\:\/\/example\.com\/$/.exec(document.location)){
	console.log("Look mam, I can regex!");
}
Posted by: Guest on March-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language