regexmatch dates

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

regexmatch dates

Post by sweet40 »

hello fellow users...

anyone willing to help on this one?

needing to match stuff like

24 Feb, 2021
03 Dec, 2018

[dd short month dddd]

using regexmatch. Thanks in advance!

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: regexmatch dates

Post by highend »

$pattern = "\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec), \d{4}";
One of my scripts helped you out? Please donate via Paypal

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: regexmatch dates

Post by sweet40 »

assuming I can also

Code: Select all

"\d{1,2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec), \d{4}";
so it's able to also capture the single digits for days, I guess it's done, thank you very much!

BTW... months can be lower cased or do I have to feed them to the pattern manually?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: regexmatch dates

Post by highend »

You've read the help file entry for regexmatches()?
One of my scripts helped you out? Please donate via Paypal

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: regexmatch dates

Post by sweet40 »

now I have! :tup:

Post Reply