Anyone figure if I made a mistake on my end or if it is a problem elsewhere?
--- In [email protected], "camlinaeizerous" <[EMAIL PROTECTED]> wrote: > > I have extended the RegExpValidator for a couple instances so I can > use them later in other with easier use. I'm getting different results > from an extended RegExpValidator comapred to when I use > <mx:RegExpValidator.../> and it is kind of confusing when the > expression strings are identical however only the mx:RegExpValidator > is working as intended. The regex expression i'm using is > > \b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b > > and it can be found as almost any example as a RegEx for IP > validation. Playing with it a bit I have not even figured out what the > extended version considers valid. I also tried giving it the > expression to a string and then using that to set the expression but I > get the same behavior. The expressions are identical as I have copied > and pasted from one another. If someone could point out something I > did wrong or if something else is going on it would be appreciated. > > ........................................................... > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute" > xmlns:v="assets.*"> > <mx:RegExpValidator source="{this.regex1}" property="text" > required="false" > expression="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"/> > <v:IPValidator source="{this.regex2}" property="text" required="false"/> > <mx:Label x="10" y="10" text="regex with expression"/> > <mx:TextInput id="regex1" x="10" y="36"/> > <mx:Label x="178" y="10" text="extended"/> > <mx:TextInput id="regex2" x="178" y="36"/> > </mx:Application> > ............................................................. > package assets > { > import mx.validators.RegExpValidator; > > public class IPValidator extends RegExpValidator > { > public function IPValidator() > { > this.expression = > "\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"; > super(); > } > } > } > ............................................................... >

