Skip to Content Skip to Menu

[#5560] PERL REGEX for validation

9 years 1 month ago - 9 years 1 month ago #271751 by edmundcheong
[#5560] PERL REGEX for validation was created by edmundcheong
/\d{6}\-\d{2}\-\d{4}/

I have the following PERL REGEX for the above. Somehow now, all my fields which have met the above condition before, is now being rejected. The format is 123456-12-1234
Last edit: 9 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 1 month ago #271762 by krileon
Replied by krileon on topic PERL REGEX for validation
What fieldtype are you using? If it's an integer field it'll always be rejected as there are non-integer characters in it. You may also want to use the following as that validation will allow prefix and suffix values.

/^\d{6}\-\d{2}\-\d{4}$/


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

9 years 1 month ago #271766 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
Thanks alot kyle.. the field is a text field.. it was working on cb 1.9 however starts prompting after the 2.0.11 update nightly built 13 october..

Thw funny thing is that is that i have another field with the same regex and it works..

The only difference is that the other is not condutioned by another field..

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 1 month ago #271781 by krileon
Replied by krileon on topic PERL REGEX for validation
Are you conditioning it with CB Conditionals? If so try disabling the condition and see if the REGEX validation works again. There shouldn't be a conflict, but it's possible there's a problem. Please also ensure you've latest CB Conditionals nightly release.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

9 years 1 month ago - 9 years 1 month ago #271898 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
The funny thing is that I have an identical field with the same parameters..

fieldtype=text

and Regex=/\d{6}\-\d{2}\-\d{4}/ is working correctly.. it is situated in another tab..

And part from that, both these fields are condtioned by other fields which is to show itself if the other field (single select) is not empty.. CB Condition version (plug_cbconditional_4.0.5.ci.2015.08.05.22.42.31+3099bd219)

Field type is installed with the CB latest 2.0.11 right? I am using nightly built pkg_communitybuilder_2.0.11.ci.2015.10.13.00.20+020e990d3

I have another name field with the REGEX /\b[A-Z][A-Z0-9]+\b/ for UPPER CASE is also not working.. the funny thing is that they are sitting on the same tab.. but was working in 1.9..

I have disabled the conditions on the fields but it is still displaying the error input eventhough we have entered according the REGEX format..

I have also disabled tab conditions and yet it is still happening..

Same thing is happening at registration.
Last edit: 9 years 1 month ago by edmundcheong.

Please Log in or Create an account to join the conversation.

9 years 1 month ago - 9 years 1 month ago #271899 by edmundcheong
Replied by edmundcheong on topic PERL REGEX for validation
At the moment, it looks like quite a number of the PERL REGEX is not allowing to enter the data to the fields due to the validation.
Last edit: 9 years 1 month ago by edmundcheong.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum