Internal Error While Using The Pattern
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “Internal error while using the pattern” while passing email validation regex to Zend_Validate_Regex up vote 0 down vote favorite I'm building a form in Zend Forms and get the following error while trying to add email validation regex: Internal error while using the pattern The code is: $email->setLabel('Email:') ->setRequired() ->addValidator(new Zend_Validate_Regex('/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$/i')) ->addValidator(new Zend_Validate_StringLength(array(3, 255))) ->addFilter(new Zend_Filter_StripTags()) ->addFilter(new Zend_Filter_StringTrim()); This regex should validate correct email address and it works in other places (e.g. in JS). I tried to remove i option and to replace \ with \\ but neither works. Any ideas? php regex zend-framework zend-form email-validation share|improve this question asked Jul 7 '12 at 22:56 bpiec 5491725 There is a built in validator for email addresses, just in case you weren't aware: framework.zend.com/manual/en/… –Tim Fountain Jul 7 '12 at 23:37 @TimFountain I know but it's pretty weak… It doesn't even validate Polish emails… –bpiec Jul 7 '12 at 23:41 check it here –Stano Jul 7 '12 at 23:42 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted Missing closing parenthesis (presumably after the final ?) share|improve this answer answered Jul 7 '12 at 23:36 Utkanos 16.2k32342 That's it! But why does it work in JS? –bpiec Jul 7 '12 at 23:52 It doesn't :) Throws a SyntaxError: Invalid regular expression error. –Utkanos Jul 7 '12 at 23:55 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a gu
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/11379303/internal-error-while-using-the-pattern-while-passing-email-validation-regex-to minute: Sign up Zend_Validator_Regex throws error: Internal error while using the pattern up vote 3 down vote favorite Message: Internal error while using the pattern "(http://)?(www.)?(youtu)((be.com)|(.be))/.*" $element = new Zend_Form_Element_Text($this->name); $element->setRequired(true) ->setLabel(FileTypes::$names[$this->fileType]) ->setDescription('Paste YouTube link here') ->setDecorators(FormDecorators::$simpleElementDecorators) ->addValidator('regex', false, '(http://)?(www\.)?(youtu)((be\.com)|(\.be))/.*'); Throws error even with simple regular expression. php regex zend-framework zend-validate share|improve this question edited Jul 25 '12 at 22:32 ByteNudger 96631527 http://stackoverflow.com/questions/11465822/zend-validator-regex-throws-error-internal-error-while-using-the-pattern asked Jul 13 '12 at 7:16 divide by zero 1,26421331 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted Have you validated your regex as correct? Try it out in a regex tool, see if it generates any errors. A decent tool should tell you why your regex is wrong if it is invalid. Most regexes I've seen are usually bookended with some kind of character, commonly '/'. The fact that yours isn't might have something to do with the error you're getting. You should also bear in mind that whilst PHP's regex is similar to Perl, there are a few differences. They probably don't matter in this case, but you should be aware of them nonetheless. http://www.php.net/manual/en/reference.pcre.pattern.differences.php share|improve this answer answered Jul 13 '12 at 7:33 GordonM 18.2k84388 Thanks, i added strips and also escaped some slashes. help. –divide by zero Jul 13 '12 at 8:05 add a comment| up vote 0 down vote try this, you need to put your pattern in an array and include the delimiters. $element = new Zend_Form_Element_Text($this->name); $element->setRequ
Page 2 of 2 < Prev 1 2 Offline Now1z3 https://bukkit.org/threads/help-an-internal-error-occurred-while-attempting-to-perform-this-command.51051/page-2 same internal error as last time on the /help and /setrank thingis .. i use a plugin called HELP becuse i don't have the code in Command book Now1z3, 22, 2011 #31 Offline Nentify @pyraetos, Are you sure you're thinking of the correct permissions plugin? PEX using modifyworld permissions to internal error stop building as far as I'm aware, not an info category with build in. Nentify, 22, 2011 #32 Offline pyraetos My BukkitDev ProfileMy Plugins (7) I'm just going off of what he's giving me. @Now1z3 Try removing the ~ character in the imbecile's inheritance, that could be causing the regex internal error while error. pyraetos, 22, 2011 #33 Offline Now1z3 Same. This is the PermissionEX i have atm and console Code: groups: Surviver: Default: false info: prefix: '&c' build: true suffix: Surviver inheritance: - Inbesil permissions: - commandbook.back.ondeath: true - commandbook.warp.list: true - commandbook.broadcast: true - commandbook.suicide: true Moderator: default: false info: prefix: '&c' build: true suffix: Moderator inheritance: - Surviver permissions: - commandbook.tp: true - commandbook.jail: true - commandbook.gamemode: true - commandbook.butcher: true - commandbook.gamemode.others: true - commandbook.kick: true - commandbook.weather: true - commandbook.spawnmob: true - commandbook.bring: true Admin: prefix: '&b[Admin]&f ' permissions: - commands.here: true - never.use.tabs: true inheritance: - Moderator Inbesil: default: true info: prefix: '&f' build: true suffix: Inbesil inheritance: options: rank: "3" permissions: - commandbook.depth: true - commandbook.help: true - commandbook.warp: true - commandbook.getpos: true - commandbook.compass: true - commandbook.back: true - commandbook.tpaccept: true - commandbook.tpdeny: true - commandbook.home: true - commandbook.sethome: true - commandbook.warp: true - commandbook.msg: