The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
reg_exp problems - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8) +--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18) +--- Thread: reg_exp problems (/showthread.php?tid=1740) |
reg_exp problems - Dogen - Nov 8th, 2011 I need to validate an e-mail field with the following format: first.last@dfw.wa.gov The expression I've come up with validates perfectly in regex validation tools, but when applied to the validation script it does not seem to work correctly. rules.push("reg_exp,email,^([a-zA-Z-']+)\.([a-zA-Z-']+)@(dfw|DFW)\.(wa|WA)\.(gov|GOV)$,Please enter your WDFW e-mail address in the following format: first.last@dfw.wa.gov"); The first or last names may contain alpha characters, dashes and/or apostrophes. The validation script does not like the begin/end string characters but if I leave them out a person could enter name.name.name.name@dfw.wa.gov Any advice would be appreciated! RE: reg_exp problems - Ben - Nov 8th, 2011 Hi Dogen, Yeah, I think I ran into this problem myself. Try double-escaping any backslashes.... I think that may have resolved it for me. - Ben RE: reg_exp problems - Dogen - Nov 8th, 2011 I think that solved it. Thanks Ben! I was batting my head against a wall trying to figure out why it wasn't working once inserted into the validation script. (Nov 8th, 2011, 10:09 AM)Ben Wrote: Hi Dogen, RE: reg_exp problems - Ben - Nov 10th, 2011 Excellent! |