Php + ajax + json provincial/municipal drop-down lists are linked. json transmission is used to verify that parameters are transmitted during login.
The following code is reserved as a mark:
Function (data ){
// Alert (data );
Var data1 = data. replace (/\ s/gm ,"");
Var data2 = data. match (/\ [(. *) \]/g ,"");
// Alert (data2 );
.............
}
The key is to understand the differences between the following pattern modifiers: www.2cto.com
Perl-style Regular Expressions allow you to place a single character option (FLAG) behind the regular expression mode to modify the matching interpretation or behavior. For example, to perform case-insensitive matching, you can simply use the I flag:
Preg_match ('/cat/I', 'Stop, Catherine! '); // Returns true if returns is true.
Table 4-12 shows the modifiers from Perl supported in Perl-Compatible Regular Expressions:
Table 4-12: Perl flag
Modifier meaning
/Regexp/I case-insensitive matching
/Regexp/s match the period (.) with any character, including the line break (\ n)
/Regexp/x remove blank spaces and comments from the Mode
/Regexp/m make ^ match the content after the line break (\ n), and the dollar sign ($) matches the content before the line break (\ n)
/Regexp/e if the replacement string is PHP code, run eval () to obtain the actual replacement string.
PHP's Perl-Compatible Regular Expression functions also support other modifiers not supported in Perl, as shown in Table 4-13:
Table 4-13: Other PHP flags
Modifier meaning
/Regexp/U reverse the greedy nature of the sub-mode; * matches as little as possible with + rather than as much as possible.
/Regexp/u treat pattern strings as UTF-8 Encoding
/Regexp/X if a backslash followed by a character with no special meaning, an error will be generated.
/Regexp/A positions the anchor at the beginning of the string, just as if there is A ^ in the pattern.
/Regexp/D make $ match only the end of a row
/Regexp/S enables the expression parser to check the structure of the pattern with greater care and speed up the second Runtime (such as in a loop)
Author: ibmfahsion