You are here: PSPad forum > English discussion forum > PSPad Syntax Error "Date Regex"
Posted by: maki | Date: 2020-01-29 14:03 | IP: IP Logged
Does not work for the PSPad regex engine
[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}
Date:
dd.mm.yy
01.20.2020
Posted by: pspad | Date: 2020-01-29 14:07 | IP: IP Logged
Because your expression is wrong. And I don't think about format dd.mm.yy and number 20 as month
Try to find error you will learn
Posted by: maki | Date: 2020-01-29 14:11 | IP: IP Logged
Nonsense. My regular expression is valid for Boost.Regex
Boost.Regex 5.1.3
John Maddock
boost.org/doc/libs/1_66_0/libs/regex/doc/html/index.html
Edited 1 time(s). Last edit at 2020-01-29 14:15 by maki.
Posted by: maki | Date: 2020-01-29 14:52 | IP: IP Logged
dd.mm.yyyy
mm.dd.yyyy
Posted by: pspad | Date: 2020-01-29 16:39 | IP: IP Logged
maki:Nonsense. My regular expression is valid for Boost.RegexBoost.Regex 5.1.3
John Maddock
boost.org/doc/libs/1_66_0/libs/regex/doc/html/index.html
There is different syntax for different regular expression engines.
You don't need to make your expression so complicated, you can use:
[0-3][0-9].[0-3][0-9].[0-9]{4}
Posted by: maki | Date: 2020-01-29 17:29 | IP: IP Logged
However, these regular expressions are imperfect.
[0-3][0-9].[0-3][0-9].[0-9]{4}
Not Date!
31.13.2020
32.01.2020
Edited 1 time(s). Last edit at 2020-01-29 17:30 by maki.
Posted by: pspad | Date: 2020-01-29 17:34 | IP: IP Logged
maki:However, these regular expressions are imperfect.[0-3][0-9].[0-3][0-9].[0-9]{4}
Not Date!
31.13.2020
32.01.2020
Same as your. It will find it too.
Regular expression doesn't serve to valid your stupid request. It can't check if february has 28 or 29 days e.t.c.
Edited 1 time(s). Last edit at 2020-01-29 17:35 by pspad.
Posted by: maki | Date: 2020-01-29 17:52 | IP: IP Logged
Do not worry. I have another magical expression, very complex (614 character). And it works in the case you're talking about.
Edited 2 time(s). Last edit at 2020-01-29 18:01 by maki.
Posted by: pspad | Date: 2020-01-29 18:19 | IP: IP Logged
Can you try with your expression:
30.02.2019
31.04.2020
Posted by: maki | Date: 2020-01-29 18:33 | IP: IP Logged
pspad:Can you try with your expression:30.02.2019
31.04.2020
Find: Regex
[Enable]: Match Whole Word
Works fine: Boost.Regex[Note 1] Boost C++ Libraries C++
en.wikipedia.org/wiki/Oniguruma
Oniguruma Kosako C
en.wikipedia.org/wiki/Comparison_of_regular-expression_engines
Edited 5 time(s). Last edit at 2020-01-29 18:41 by maki.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR