This is a discussion on what is regular expression? within the PHP Programming forums, part of the Web Development category; in php or Java Script i dont like a word regular expression. How can i understand the regular expression eascilly. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| in php or Java Script i dont like a word regular expression. How can i understand the regular expression eascilly. please give a example from scratch to massive. Thanks in advance. |
| Sponsored Links |
| |||
| Hi, A regular expression is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*\.txt. But you can do much more with regular expressions. In a text editor like EditPad Pro or a specialized text processing tool like PowerGREP, you could use the regular expression \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b to search for an email address. Any email address, to be exact. A very similar regular expression can be used by a programmer to check if the user entered a properly formatted email address. In just one line of code, whether that code is written in Perl, PHP, Java, a .NET language or a multitude of other languages. Since "regular expressions" is a mouthful, you will usually find the term abbreviated as "regex" or "regexp". I prefer "regex", since it can be easily pluralized as "regexes".
__________________ Regards, Senraj.A |
| |||
| Hi, Here the small example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| this example Returns true if client browser is Netscape 2, 3 or MSIE 3. PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| This example check valid email or not using regular expression if valid returns true. PHP Code:
__________________ Thanks & Regards, R.Kamalakannan. |
| |||
| This example for checking US zipcode format valid or not if valid returns true. PHP Code:
__________________ Thanks & Regards, R.Kamalakannan. |
| |||
| This example for checking US phone number format valid or not if valid returns true otherwise false. PHP Code:
__________________ Thanks & Regards, R.Kamalakannan. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use Regular expression in Java? | S.Vinothkumar | Java Programming | 3 | 11-28-2007 08:45 PM |
| Regular expression tips & tricks | prasath | Database Support | 8 | 09-24-2007 09:55 PM |
| Regular expression | Sathish Kumar | C# Programming | 23 | 09-10-2007 06:00 AM |
| Can any one give regular expression for this string? | raj | PHP Programming | 1 | 07-24-2007 11:42 PM |
| Regular expression | vadivelanvaidyanathan | Perl | 0 | 07-15-2007 06:21 PM |