Answers for "javascirpt regex"

1

js regex

// get "bucket1337" from https://bucket1337.appspot.com.storage.googleapis.com/staging/blender_input/162480.glb"

//define string
let string = "https://bucket1337.appspot.com.storage.googleapis.com/staging/blender_input/162480.glb"

//define regexp
let bucketRegex = new RegExp(`(?<=https:\/\/).*(?=.app)`, 'gm')

// execute regexp
let result = string.match(bucketRegex)[0]
Posted by: Guest on June-30-2021
10

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