1 Reply Latest reply on Oct 8, 2010 10:34 AM by kvanderwende

    Regular Expression for URL validation problem

    kvanderwende

      We have a standard regular expression for validating URLs that are allowed to be entered.  It works fine in JavaScript but it doesn't work the same in ActionScript.  Specifically in a RegExValidator.

       

      ^(([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|net|org|[a-zA-Z]{2}))([0-9]+)*(\/($|[a-zA-Z0-9\. \,\?\'\\\+&\=~_\-]+))*$

       

      That is the regular expression that should allow IP addresses, .com, .net, .org OR two character codes like .co, .in, etc.

       

      My validator looks like this:

              <mx:RegExpValidator id="linkName_regExpV"
                      source="{linkName}" property="text"
                      flags="g"
                      expression="{MediaManagerModel.mediaManagerObj.MediaUISettings.getItemAt(mediaType).RegEx NameValidator}"
                      valid="validateForm(event)"
                      invalid="validateForm(event)"
                      trigger="{linkOK}"
                      triggerEvent="click"
                     
                     />

       

      The expression is a string that is part of our configuration.

       

      What am I missing and is there a tool that validates Flex regular expressions?  Everything I am able to find is a regular expression validator written in Flex.

       

      Thanks,

      Kevin