⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

set_rules regex_match not working

set_rules regex

  • Please log in to reply
1 reply to this topic

#1 Faisal Naseer

Faisal Naseer


  • Members
  • Pip
  • 5 posts

Posted 26 July 2016 - 03:08 PM

I am trying to create regex validation on a field  named start_time in particular table

$crud->set_rules('start_time','Start Time','regex_match[/^(?:07:30|(0[8-9]|1[0-6]):[03]0)$/]');

reg ex is completed tested on regex101.com

but as I add or edit field I come across with error Unable to access an error message corresponding to your field name Start Time.(regex_match[/^(?:07:30)




#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

Posted 28 July 2016 - 11:10 AM

Hi there,


If u refer to the set rules documentation - this is the same as the codeigniter rules.



What you should be doing here to have a workaround is callback method where u do the processing of the data validation.

look for the line below in the url above - it will give u the example for what i am saying

$this->form_validation->set_rules('username', 'Username', 'callback_username_check')


Happy GCing :)

Also tagged with one or more of these keywords: set_rules, regex

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users