PHP regular expression syntax reprinted from: http://blog.csdn.net/kkobebryant/article/details/267527
Basic regular expression syntax
First, let's take a look at two special characters: '^' and '$'. they are used to match the start and end of the
I have written eregi (& amp; #39; ^ ([_. 0-9a-z]) + @ ([_ 0-9a-z-]) +. ([0-9a-z _-.]) + & amp; #39;, & amp; quot; luan78zao@hotmail.com & amp; quot;, $ vali questions about regular expressions
What should I do with the regular expression of email
PHP 5.3 starts with a better transition to future versions of PHP (PHP6), marking functions that are no longer supported in the future as DEPRECATED. Using these functions in your code will relentlessly display a warning message in the page: "Using
The correct format for the message is: User name +@+ server name +. +com/net/cn/orgNote: 1, verify that the user name is the size of letters or lowercase letters2, after the user name to add @3, after the @ To add the name of the server.4, after the
To use a high version of PHP on IIS6, you must install the fastcgi extension,
Microsoft FastCGI Extension for IIS 5.1 and 6.0
Then let your IIS6 support fastcgi.
Then set the CGI and fastcgi parameters in php.ini:
Fastcgi.impersonate = 1
Surely many people have a headache for regular expressions. Today, I have my knowledge, plus some articles on the Internet, I hope to be able to understand the average person's expression. To share the learning experience with you.
At the beginning,
Info.inc.php mainly do some judgment and information processing
function Update ($REGINFO)
{
Switch ($reginfo [4])
{
Case ($reginfo [4]==1):
$reginfo [4]= "male";
Break
Default
$reginfo [4]= "female";
Break
}
Switch ($reginfo [11])
{
Case
Info.inc.php mainly do some judgment and information processing
function Update ($REGINFO)
{
Switch ($reginfo [4])
{
Case ($reginfo [4]==1):
$reginfo [4]= "male";
Break
Default
$reginfo [4]= "female";
Break
}
Switch ($reginfo [11])
{
Case
"^the": matches a string that starts with "the";
"Of despair$": matches a string ending with "of despair";
"^abc$": matches a string that begins with ABC and ends with ABC, and is actually only matched by ABC;
"Notice": matches a string
There are two sets of regular expression libraries in PHP that are similar in functionality, but have slightly different execution efficiencies:
A set is provided by the Pcre (Perl compatible Regular Expression) library. A function named after a
Programming | network | Regular application Example
With a more comprehensive understanding of regular expressions, you can use regular expressions in perl,php, as well as in programs such as ASP.
The following is an example of the PHP language,
1. Getting Started
In short, regular expressions are a powerful tool for pattern matching and replacement. We can find regular expressions in almost all UNIX-based tools, such as the vi Editor, Perl or PHP scripting language, and awk or sed shell
This article mainly introduces the php form sensitive character filtering class and its usage examples. it analyzes in detail the form generation and submission processes to filter sensitive characters. it is a very practical technique, for more
Php looks at instances to learn regular expressions. First, let's look at two special characters: ^ and '$. they are used to match the start and end of the string respectively. The following are examples: first, let the instance learn regular
First, let's take a look at two special characters: '^' and '$'. they are used to match The start and end of The string respectively. The following example shows "^ ": matches a string starting with ";
"Of despair $": match the string ending with
? Phpif (eregi (^ [_. 0-9a-z-] + @ ([0-9a-z] [0-9a-z-] + .) + [a-z] $, $ email) {echo your e-mail through a preliminary check ;}? In this sentence, an eregi function is first applied, which is quite understandable. If you look for a book, you can
First, let's take a look at two special characters: '^' and '$'. they are used to match The start and end of The string respectively. The following are examples: ^: match a string starting with The; ofdespair $: match a string ending with ofdespair;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.