How do I get the word after the last dot using Regex and JS?
const yeah = 'SampleLibrary/21.0/Best.colour'
const hello = yeah.replace('(?<=\.|^)[^.] $')
console.log(hello)
EXPCTECTED OUTPUT
colour
CodePudding user response:
This should work:
const yeah = 'SampleLibrary/21.0/Best.colour'
const hello = yeah.replace(/^. \./, '');
console.log(hello)