Answers for "js regex between two words"

0

js regex between two words

const text = 'My cow always gives milk'
const start = `cow`;
const end = `milk`;
const middleText = text.split(start)[1].split(end)[0]
console.log(middleText) // prints "always gives"
Posted by: Guest on October-13-2021
0

js regex between two words

const text = 'My cow always gives milk'
const start = `cow`;
const end = `milk`;
const middleText = text.split(start)[1].split(end)[0]
console.log(middleText) // prints "always gives"
Posted by: Guest on October-13-2021

Code answers related to "js regex between two words"

Code answers related to "Javascript"

Browse Popular Code Answers by Language