I want to create a regular expression for detecting the publication date for a book in Amazon. I’m extracting the data for all items and I want to find a publication’s date. All of these has this structure:
Month day, year.
The month is only represented by 3 chars, and the day could have one or two numbers (e.g Dec 5, 2011 or Dec 22, 2011). The year always have 4 numbers.
How I can do a regex in JavaScript to find this?
Thanks in advance !!
This:
will get you going.
match[1]hold months,match[2]days andmatch[3]years.I will omit explaining the regex. I leave it as an exercise to you. You should visit the infamous regex tutorial here.