Skip to content

Instantly share code, notes, and snippets.

@TrySpace
Created September 26, 2019 16:04
Show Gist options
  • Save TrySpace/c1078a7a2e82ee1bcf634cb80ddae76d to your computer and use it in GitHub Desktop.
Save TrySpace/c1078a7a2e82ee1bcf634cb80ddae76d to your computer and use it in GitHub Desktop.
regex test
function test () {
const split = ["man", "man"];
const pathRegex = new RegExp(/^[A-ZÀ-Ýa-zà-ý0-9_]+[^.#$?\[\]]$/g);
console.log(split)
split.forEach((word: string, key) => {
console.log(key)
if (pathRegex.test(word)) {
console.info('Word:', word)
tags.push(word)
} else {
console.log('Not word:', word)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment