I want to extract some words from a string.
The 24,000th eligible entrant will win. This giveaway started September 14,
2018 3:35 PM PDT and ends the earlier of September 21, 2018 11:59 PM PDT or
when the prize has been awarded.
The words I would like extracting are:
- 24,000th
- September 14, 2018 3:35 PM
- September 21, 2018 11:59 PM
I have tried using the following:
$regex = "[\d,]+th|\w+[\d\s,:]+PM";
if (preg_match($regex, $str, $match)) {
echo $match[0];
}