-
A problem of regular expressions
hello big red cat
hello big red dog
hello yellow bird
hello 123 555 blue cat and dog
...
in a paragraph of text, I need to match to
hello big red cat
hello 123 555 blue cat
this is how I wrote these two sentences
hello[ s S]*cat$
results match all...
-
The two matching results of regular expressions are not the same.
? & ab&cd&ef matching rules [&] {0jue 1} ab and [&] {0jue 1} cd replacement characters are empty but the results of the two machines are different: one is? & ef, and the other is normal? & ef is it because {0jimi 1} to match? ...
-
How does js use rules to find the content specified in the string
1. The string str= "zz=aaa,bb=bbb,cc=ccc;User=ZZZ&zz=aaa1&bb=bbb1&cc=ccc1 " 2. To implement, for example, I pass in the parameter zz, and find the value of aaa1 in the zz=aaa1 after User=ZZZ. How to write the corresponding rule? ...
-
Python regular extraction of parentheses and the contents of parentheses
for example, a string: American (United States of) to extract: (United States of) or Abcde (Df WD asdAS ASDW) to extract: (Df WD asdAS ASDW) to use regular expressions Thank you guys ...
-
Php matches the src content of img tags, too much?
$res = preg_match_all( src="(.+ .(png|jpg))"+? , <img src=" Public attached image 20170227 20170227143202_25223.jpg" alt="" ><img src="Public attached image 20170227 20170227143202_25223.jpg" alt=&...
-
Python regular expressions extract the contents of parenthetical quotation marks in multiline strings.
recently learned python regular expressions, want to use regular expressions to extract the specified string in multiple lines
I have been searching the Internet for a long time, and there are a lot of people asking questions on the Internet, but they...
-
How does the python regular take out two values?
question: take out the values of status and request_time in the log:
this log cannot be matched by script:
{"@timestamp":"2018-03-30T19:24:26+08:00","server_addr":"172.31.0.24","remote_addr":"10....
-
JAVA regularity
question: enter parameters of two arbitrary integers, such as 88-3333, and return a regular expression that matches all values in the range. A problem that looks simple at first, but then finds that the implementation is too complex (not sure whether it...
-
How can python regular expressions not return unmatched group
use reg = (? < = mileage). (re.findall: km | km (?! ) | (em: km | km (?! ). (? = mileage) the method is re.findall
the text above is input the list below is output
for example, for the first one, I only need to take 34km , for example, fo...
-
Php regularization (interview questions)
:span
: <span style="color:red">< span><span>good< span>
:<span style="color:red">< span><span>good< span>
...
-
How do you modify part of a string through regular expressions in javascript?
demand background:
A background system of the company. The form page is paged with ajax. After clicking on the page, you want the current url to record the paging information, so that when you refresh the current page, the paging information will not ...
-
Regular expressions: begin with lowercase letters and end with uppercase letters of at least 6 digits
^ [Amurz]. {4,} [Amurz] $ this is OK (^ [Amurz]. * [Amurz] $) {6,} it is not possible to ask why I require the length of the whole expression as a whole to reach 6 digits ....
-
How to write a regular ID number that matches 15 digits, 18 digits, and the last character is a letter?
guys, I want to use a regular expression to match 15-bit, 18-bit, and alphabetic ID numbers in a bunch of strings. The pile of strings is as follows:
| _ Potentially risky methods: TRACE | _ http-server-header: 2.4.23 (Win32) OpenSSL 1.0.2j PHP 5.4...
-
Assertion (?!) in regular expression What position does it match without a suffix expression?
(?!) Zero width negative antecedent assertion, attempts to match always fail because there is no suffix expression
how to understand this sentence. If you can give an example.
...
-
/ ^ (18 [0-9] {9}) | (15 [0-9] {9}) $/ regular matching problem
^ (18 [0-9] {9}) | (15 [0-9] {9}) $ Why the rule matches 1844444444444444 . My understanding of this rule is starting with 18 or 15 followed by 9 digits 0-9 .
Note: I know there are other ways to write the rules of mobile phone numbers. I just ...
-
Find a numerical regular expression that ends with n zeros
such as title: find a numerical regular expression that ends with n zeros. Thank you ...
-
Ask for a java regular expression
<span style="text-align: justify; font-size: 114px;"><span>
<span style="text-align: justify; font-size: 114px;"><span>
as in the text above, I want to get all the values with px set. I originally wrote Patte...
-
How regular expressions match spaces, [], ()
The range of characters is text, letters, numbers and "( ", ") ", "[ ", "] ", "space "; how should the rule of up to 20 words be written ...
-
Regular, / ^\ s + |\ smatches / and / ^ (\ s +) |\ 1matches / why the matching results are not the same.
^ s+| s+$
^( s+)| 1$
^[A-Z]| [A-Z]$
^([A-Z])| 1$
I don t know where to understand the problem, the problem of symbol priority? Or something else, if anyone can answer, thank you very much.
...
-
How do I return the index value of a regularly matched object in python?
The expression in the question is a little unclear: specifically, the reason is a malfunction of the CPU circuit board and needs to be replaced. B= CPU circuit board import re C = re.search (A Magi B) print (C) how to get the index value of CPU c...