Feedback: Regex functionality in pattern matching:: Personally I don't like SIMILAR either, though. How about a REGEX function with REGEX somewhere in the name? Posted by aaronbertrand on 3/21/2007 at 1:23 PM http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=261342HOME | So as far as my searching skills will allow, there simply isn't any support for regular expressions in AS2. Does anyone have any experience / know of any tutorials that can achieve a similar effect? I don't need anything too complex - just some email validation and simple character checking. Regular Expression Tutorial - Learn How to Use Regular Expressions:: Oct 7, 2008 Many more recent regex engines are very similar, but not identical, to the one of Perl 5. Examples are the open source PCRE engine (used in http://regular-expressions.mobi/tutorial.htmlHOME |
Well you can use indexOf for validation:
String.indexOf
Availability
Flash Player 5.
Usage
myString .indexOf( substring, [ startIndex ] )
Parameters
substring An integer or string specifying the substring to be searched for within myString .
startIndex An integer specifying the starting point in myString to search for substring. This parameter is optional.
Returns
The position of the first occurrence of the specified substring, or -1.
Description
Method; searches the string and returns the position of the first occurrence of the specified substring . If the value is not found, the method returns -1.
so for example to validate an email:
function validateEmail(emailText:String){
if (emailText.indexOf("@")!=-1 && emailText.indexOf(".")!=-1){
//place code for valid email here
}else{
//place code for invalid email here
}
}
Sexcellent idea, thank you.
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|