Answers for "named regex group JS"

0

named regex group JS

const auth = 'Bearer AUTHORIZATION_TOKEN'
  const { groups: { token } } = /Bearer (?<token>[^ $]*)/.exec(auth)
  console.log(token) // "Prints AUTHORIZATION_TOKEN"
Posted by: Guest on July-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language