regex - Creating a conditional to validate Email addresses -
I have used a preg_match based 'regex' in a PHP script which I use. Regex is How can I include it in a bet condition to test the email address for the original structure? My email address is in a file called 'email' (it is looped as it is necessary). Like Using your regular expression and assigning it to Note: The actual specificity for the email address, (see), is very complex (see this sample old) and your regex is just an approximation. ^ [\ w .-] + @ [\ w .-] + \. [AZA-Z] {2,6} $
if [cat email | '/^[\w-]+@[\w-]+\.[A-Za-z] {2,6} $ /']; Then {{/ code> or whatever, I do not know how to write it. Anyone can help you ...
bash variable
email :
#! To test the address in / bin / bash if [[$ $ email = ~ ^ [[: alnum:] _ -] + @ [[:: alnum:] _.-] + \. [[Alpha:]] {2,6} $]] Then "good address" echo resonance "bad address" fix <
[[...]] so that a simple POSIX will not open:
bash or better needed.
= ~ operator matches a string, in this case the email address, a POSIX extended regular expression
Comments
Post a Comment