Yes Scott, all is clear now. And since initial question was how to make this example works with as2lib, I think my advice to put "*" at the end of the pattern was correct ;)
Regards, Igor -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Hyndman Sent: Friday, February 24, 2006 7:02 PM To: Open Source Flash Mailing List Subject: Re: [osflash] Regular Expression Class? Well, again. I don't know your API. I thought that matches() would have worked like IsMatch(), but as you said, it's more like for find(). Given my understanding, what I said was correct. Scott -----Original Message----- From: [EMAIL PROTECTED] on behalf of Igor V. Sadovskiy Sent: Fri 2/24/2006 11:51 AM To: 'Open Source Flash Mailing List' Cc: Subject: Re: [osflash] Regular Expression Class? I don't agree with you. For Java-like RegExp implementation: var p : Pattern = new Pattern("[^A-Za-z0-9]"); var m : Matcher = p.getMatcher("@"); logger.debug(m.matches()); // TRUE var m : Matcher = p.getMatcher("@@"); logger.debug(m.matches()); // FALSE Regards, Igor -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Hyndman Sent: Friday, February 24, 2006 6:42 PM To: [email protected] Subject: Re: [osflash] Regular Expression Class? Oops, little mistake. The example should read: Regex re = new Regex("[^A-Za-z0-9]"); re.isMatch("Thisisatest135813"); // false re.isMatch("This-is-another-test"); // true Then negate. Igor, in case you're wondering why your test worked, it's because * means 0 or more. You were matching nothing, and of course nothing is a valid match (because of *) so it returned true. Scott -----Original Message----- From: Scott Hyndman Sent: Fri 2/24/2006 11:32 AM To: Open Source Flash Mailing List Cc: Subject: RE: [osflash] [Spam]Re: Regular Expression Class? I think you've misunderstood what he's trying to do. The pattern is quite correct. He's actually trying to match characters that are not allowed. Then all you do is take the negation, and you've got an alphanumeric match. I'm not familiar with your implementation, but in .NET I would say: Regex re = new Regex("[^A-Za-z0-9]"); re.isMatch("This is a test 135813"); // false re.isMatch("This-is-another-test"); // true Then negate. Scott -----Original Message----- From: [EMAIL PROTECTED] on behalf of Igor V. Sadovskiy Sent: Fri 2/24/2006 9:33 AM To: 'Open Source Flash Mailing List' Cc: Subject: Re: [osflash] [Spam]Re: Regular Expression Class? Actually talking, Pattern is incorrect. Correct pattern must be: [^A-Za-z0-9]* (asterix at the end). I've just tested it with current as2lib implementation and all works properly. Regards, Igor -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Hyndman Sent: Friday, February 24, 2006 4:11 PM To: Open Source Flash Mailing List Subject: Re: [osflash] [Spam]Re: Regular Expression Class? That appears to be correct if you're returning !matches as a valid password. I tested it actually (not in ActionScript) and it's fine. You should submit a bug report. Scott -----Original Message----- From: [EMAIL PROTECTED] on behalf of Jim Tann Sent: Fri 2/24/2006 8:52 AM To: Open Source Flash Mailing List Cc: Subject: [Spam]Re: [osflash] Regular Expression Class? Ah Igor just the man. I have just been playing with as2lib's regex classes as it happens but would like a pointer or two if that's ok. I am trying to use regex to check if a password is alpha numeric, this is the code: function checkPass(strPassword:String):Boolean{ var regexPassword :Pattern = new Pattern("[^A-Za-z0-9]"); var matchPassword :Matcher = new Matcher(regexPassword, strPassword); return matchPassword.matches(); } It is always returning false, im sure my syntax is wrong. Can you point me in the right direction please? Jim -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor V. Sadovskiy Sent: 24 February 2006 13:43 To: 'Open Source Flash Mailing List' Subject: Re: [osflash] Regular Expression Class? Hello Jim. As2Lib (www.as2lib.org <http://www.as2lib.org/> ) has RegExp implementation. Regards, Igor _____ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim Tann Sent: Friday, February 24, 2006 3:33 PM To: Open Source Flash Mailing List Subject: [osflash] Regular Expression Class? Hey, Does anyone have an actionscript implementation of regular expressions? Jim _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
