- Posts: 4
- Thank you received: 0
Help with RegExp for Date
- pippasoup@gmail.com
-
Topic Author
- Offline
Less
More
10 years 7 months ago #229279
by pippasoup@gmail.com
Help with RegExp for Date was created by pippasoup@gmail.com
-- HikaShop version -- : HikaShop Business: 2.6.1
-- Joomla version -- : Joomla! 3.4.8
-- PHP version -- : 5.5.10
-- Browser(s) name and version -- : Chrome
I've created a custom text field for a date (format: dd/mm/yyyy) and trying to write
a regexp to catch those that don't match. Not sure how it should be formatted
within the custom field screen. The field is required, so regexp should be checked.
Thanks
-- Joomla version -- : Joomla! 3.4.8
-- PHP version -- : 5.5.10
-- Browser(s) name and version -- : Chrome
I've created a custom text field for a date (format: dd/mm/yyyy) and trying to write
a regexp to catch those that don't match. Not sure how it should be formatted
within the custom field screen. The field is required, so regexp should be checked.
Thanks
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229288
by nicolas
Replied by nicolas on topic Help with RegExp for Date
Hi,
It depends what you want to check exactly. For example, you could write:
It depends what you want to check exactly. For example, you could write:
Code:
/^[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]$/
The following user(s) said Thank You: pippasoup@gmail.com
Please Log in or Create an account to join the conversation.
- pippasoup@gmail.com
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
10 years 7 months ago #229401
by pippasoup@gmail.com
Replied by pippasoup@gmail.com on topic Help with RegExp for Date
I tried that, but it doesn't recognize the string as valid. I see that its expecting
dd/dd/dddd (d=digit/number). Images shows the error appear when a valid string
is entered and the backend setup of the field (with the regexp).
I'm confused!
dd/dd/dddd (d=digit/number). Images shows the error appear when a valid string
is entered and the backend setup of the field (with the regexp).
I'm confused!
Please Log in or Create an account to join the conversation.
- pippasoup@gmail.com
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
10 years 7 months ago #229448
by pippasoup@gmail.com
Replied by pippasoup@gmail.com on topic Help with RegExp for Date
Got it fixed.
Drop the / .... /
as part of the expression.
Thanks
Drop the / .... /
as part of the expression.
Thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.146 seconds