Re = new Regexp ("pattern", ["Flags"]) [/Code]ParametersReRequired. Name of the variable to be assigned a value in the regular expression mode. PatternRequired. The regular expression mode to use. If Syntax 1 is used, use the "/" character separation mode. If syntax 2 is used, quotation marks are used to mark the format. FlagsOptional. If syntax 2 is used, the flag is enclosed in quotation marks. The flag can be used in combination and available include:[Code] G (all pattern in full-text sear
the variable to be assigned a value in the regular expression mode.PatternRequired. The regular expression mode to use. If Syntax 1 is used, use the "/" character separation mode. If syntax 2 is used, quotation marks are used to mark the format.
FlagsOptional. If syntax 2 is used, the flag is enclosed in quotation marks. The flag can be used in combination and available include:G (search for all occurrences of the pattern in full text)I (Case Insensitive)M (multi-row search)ExampleThe following
($ data );?>
The output result is as follows:
The Code is as follows:
Array ([0] => 1[1] => 2[2] => 5[3] => 7[4] => 8)
You can also use the rsort () function for sorting. The result is the opposite to the previous simple sorting result of sort. The Rsort () function is used to reverse the array elements from high to low. It can also be arranged by number or in alphabetical order. Listing B shows an example of Listing:
Listing B
The Code is as follows:
?>
The output result is as follows
Sort (): Simple sorting of an array element from low to high, this function can be arranged numerically or alphabetically.
Listing A
$data = array(5,8,1,7,2); sort($data); print_r($data);?>输出结果如下所示:Array ([0] => 1[1] => 2[2] => 5[3] => 7[4] => 8)
Rsort (): An array of elements are inverted from high to low, and can be arranged numerically or alphabetically.
$data = array(5,8,1,7,2);rsort($data); print_r($data);?>它的输出结果如下:Array ([0] => 8[1] => 7[2] => 5[3] => 2[4] => 1)
Ksort
alphabetical order. Listing B shows us an example of it:
Listing B
Copy CodeThe code is as follows:
?>
It outputs the following results:
Copy CodeThe code is as follows:
Array ([0] = 8
[1] = 7
[2] = 5
[3] = 2
[4] = 1
)
Sort by keyword
When we use arrays, we often reorder them from high to low according to the keyword. The Ksort () function is a function that sorts according to the keyword, while it maintains the relevance of the keyword during sorting. Listing C is an example:
Listing C
In this article, each person will send a giant open-source Chinese mouse pad. we just added an article on the translation channel:
Badoo tells you that switching to PHP7 saved $1 million
Http://www.oschina.net/translate/how-badoo-saved-one-million-dollars-switching-to-php7
This is an article highly recommended by PHP bigbird. I entrust my organization to open-source Chinese members to translate this ar
the left end.// Sample. It is possible that multiple characters can be jumped directly (up// Strlen (sFind) characters). If the rightmost character matches, it will be traced back. For example://// Pain// ^ This is the first time to compare the ratio of n to space.// The rain in SpainThe rain in Spain//// Pain// ^ This is the second comparison. It's cool!// The rain in SpainThe rain in Spain//// Of course,
the global flag is not set, exec ignoresThe value of lastIndex, which starts from the start position of the string.
The array returned by the exec method has three attributes: input, index, andLastIndex. The Input attribute contains the entire searched string. The Index attribute contains the position of the matched substring in the searched string. LastIndexThe attribute contains the next position of the last character in the match.
Example \\The following example illustrates the usage of the
The reason for this is the Brazil region. It is very simple, because in the present performance, there should be no suspense when Brazil enters the finals.
Netherlands 2:1 Slovakia
For me, this is the least interesting thing to watch in the 1/8 finals. The last memories left me by the Netherlands are the memories of bogkkkamp's time-out match and the beloved Argentina. The memories of 12 years ago are still nightmare memories! So, watching the ball and working last night should be said to be
Friday, August 8
, 29th Olympic Games opening ceremony, cctv1, 2, Olympics, HD
Aspect Introduction 1. How to interpret Chinese elements?2. How to ignition the main torch tower?3. Who finally ignited the main torch tower?4. How can fireworks make everyone better off?5. Can theme songs recreate the myth of hand in hand? Who will sing?
6. Who will walk the Chinese flag in?
Saturday, August 9
8: 34 women's 10-meter air rifle qualifying match-HDWomen's Basketball preliminaries 1st game
problem, it is arguably not a difficult task to write a solution program in Erlang. Post the zebra issue first: Five Men of different nationality (England, Spain, Japan, Italy, Norway) live in the The the the the "a street." They all have a profession (painter, diplomat, violinist, doctor, sculptor), one animal (dog, Zebra, fox, snail, hors e), and one favorite drink (juice, water, tea, coffee, milk), all different from the others. Each of the houses
franc is decoupled from the euro, Sterling can be exchanged for more euros.For multinationals, it might be a good choice if you invest in the euro now.The devaluation of the euro, the renminbi can save a lot of money against the euro, Li Ka-shing is marching into Europe. Mergers and acquisitions, investment or, as investors say, buying at bargain lows. As oil prices fall, many industries in Europe have prospects for investment returns.For individuals, if you are studying or traveling to Europe
First, substring methodReturns a substring at the specified position in a string object.Strvariable.substring (start, end)"String Literal". Substring (start, end)ParametersStart------Indicates the starting position of the substring starting at 0.The end------indicates where the substring ends, starting at 0.Description: The method will return a string containing a substring from start to last (not including end).The substring method uses the smaller values from start and end as the starting poin
for Computational Linguistics (NAACL). New Orleans, USA.
3-6 Jun, Pacific-Asia Conference on Knowledge Discovery and Data Mining (PAKDD). Melbourne, Australia.
3-7 Jun, Predictive Analytics World Las Vegas. Las Vegas, USA.
4 Jun, Data Science Salon New York. New York, USA.
5-6 Jun, Gartner Data Analytics Summit. Mumbai, India.
6-7 Jun, Machine Intelligence Summit Hong Kong. Hong Kong.
11-12 Jun, CogX London 2018: Festival of All Things AI. London, UK.
12-13 Jun, AI Toronto. Toronto, Canada.
12
Match methodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match (RGEXP)ParametersStringobjRequired option. A string object or string literal on which to find.RgexpRequired option. is a regular expression object that contains the regular expression pattern and the available flags. It can also be a variable name or string literal that contains the regular expression pattern and the available flags.The rest of
ambassador's son, the Ambassador of Spain, has chosen such a path to let the wheat have a graceful and comfortable life. What can he give her?When they graduated in July, Mo pushu sent a whole box of high-priced mints for the wheat, all of which were owned by the lotus brand. The price was very high, will it always be time to eat more mints? Mo pushuBut I smiled and said, when you are so big, you probably won't eat sugar. When I sent the mopark tree
ExistsReturns true or false, depending on whether the result set returned by the subquery contains at least one row. Unlike other predicates (such as in) and logical expressions, exists cannot return unknown. Subquery or return the row set, or do not return. If a subquery filters a special row and returns the unknown result, the row is not returned to the subquery result set. In the filtering process, unknown is treated as false. In other words, in a subquery with filtering conditions, the preco
= "The rain in Spain falls mainly in the plain"; Re =/(a) in/ig; Creates a regular expression pattern. r = S.match (re); Try to match the search string. document.write (R); The returned array contains all four occurrences of "Ain", R[0], r[1], r[2], r[3]. But no child matches a. Output Result: Ain,ain,ain,ainexec methodFinds in a string with a regular expression pattern, returns the first value (array) of the lookup result, and returns null if the ma
Match MethodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match (RGEXP)ParametersStringobjRequired option. A string object or string literal on which to find.RgexpRequired option. is a regular expression object that contains the regular expression pattern and the available flags. It can also be a variable name or string literal that contains the regular expression pattern and the available flags.The rest of
Match MethodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match (RGEXP)ParametersStringobjRequired option. A string object or string literal on which to find.RgexpRequired option. is a regular expression object that contains the regular expression pattern and the available flags. It can also be a variable name or string literal that contains the regular expression pattern and the available flags.The rest of
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.