Hey there, I have an input data that goes like this “Novermber 26th & 27th”
I am looking for a pattern where I could get the output as
1.November 26th
1.November 27th
Is this possible with patterns? If so how.

Thanks :)
Hey there, I have an input data that goes like this “Novermber 26th & 27th”
I am looking for a pattern where I could get the output as
1.November 26th
1.November 27th
Is this possible with patterns? If so how.

Thanks :)
Best answer by GetUWired
Try changing this line from
let dateMatches = inputDate.match(/\d{1,2}th|st|nd|rd/g)
to
let dateMatches = inputDate.match(/\d{1,2}(th|st|nd|rd)/g)
As far as how to learn this, Regexr is a great tool for writing Regular Expressions: https://regexr.com/
The code is written in Javascript and there are a TON of resources online: https://www.freecodecamp.org/news/learn-javascript-free-js-courses-for-beginners/
and once you get used to the lingo Google becomes a great help!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.