^(?: (?=$))?$ this rule is used to match the of an empty string. "".match( ^(?: (?=$))?$ ) ["", index: 0, input: "", groups: undefined] "1".match( ^(?: (?=$))?$ ) null ? = I know this is an antecedent ...
in the project, use regular matching img tags in the article. There is obviously img in the string passed in, but it is empty with regular matching. Baidu has searched a lot of regular expressions matching pictures, but still can t match them. imgReg =...
crawl a website with scrapy. The data is generated by js. The script, extracted by xpath is obtained as follows: define("page_data", { "uiConfig": { "type": "root", ...
there are some troublesome data. The date is a mixture of mm.dd, mm.d, m.dd and m.d. I want to match it with a regular. I write a data like this: ^ ([1-9] | 0 [1-9] | 1 [0-2]) ( .) ([1-9] | 0 [1-9] | 1-2 | 3 [0-1]) $ g. I found that this data can mat...
there are two serial services, one written by go and the other written by Python. use regular verification email address, found that the results of the two code verification are not consistent, and now want to unify the verification effect. Regular exp...
problem description in the project, you need to use a rich text editor to edit the text and pass it to the back end. the front end uses ...
the requirement is to remove the fixed format string from a js string, such as result = "123456789" ...
how does nodejs brush out all the Chinese in the text? Extract all Chinese from a html page or js text (retain any characters between the characters and remove all annotated text) and put it into another text? var getId = function(id) { ...
recently, I was learning about crawlers, and then I used get to connect to the web page, and then I asked a lot of questions. I said one by one, when I get, I added the following information params = header header = {user-agent: xxxx} the resulting te...
input: aaaaddabcabcabc use regular to replace the ending n abc with output: aaaadd the following can only replace the last substring: nt n n tqwe n t<br > nqwe n n n t<br > n n n t<br > n n...
interview encountered such a question, there is a string, "12345678abcABCDefghijk9874321YXWV321 ", now define the same type of characters (numbers for one type, uppercase letters for one type, lowercase letters for one type) for 4 or more consecutive, n...
not long after I first came into contact with python, I needed to use regularities when crawling pages, but I was confused after reading python s re library for a long time. Maybe I got silly after a whole day s work. =-sharp I have many of the follow...
The problem is as follows, as seen in the python getting started manual, re.sub () replaces I know the syntax of re.sub (regular string, replacement string, original string), but I don t understand this I also know that 1 is equivalent to re.sea...
the code is as follows: re.compile( ^( d{1,2}: )(.*?)(:) ) what is the logic and result of this code matching? Thank you. ...
2 var s = 12.34567 12.34 console.log(s.replace( . d{2} , * )) 12*567 console.log(s.replace( .[^ d]{2} d+ , * )) 12.34567...
the code is as follows: re.compile( [A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2} ) re.compile( [0-9a-fA-F]{4}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}.[0-9a-fA-F]{1} ) Please help parse the logic of this regular...
python regular matches the contents of the specified start HTML tag and end tag <div class="pbm mbm bbda cl"> <h2 class="mbn">< h2> <a href="http: bbs.aa.cc home.php?mod=spacecp&ac=p...
how do you use Python to match the two parameter values in SetValue in the following string? for example, several pieces of data failed to match between "Att_Sys_zh-cn_11_G " and 12 12 5 . <script> function init(){ SetValue( txt_gtin , &...
I use nginx and then I want nginx to satisfy XXXXXXXXXXXXX.. File suffix? md5=XXXXX (for example: test.jpg?md5=cno234f or test.mp4?md5=i9345nmjf ) access to a directory with alias , how can this rule be implemented? Thank you very much ...
for example: Establishment date: June 20, 2017; Business term: from June 20, 2017 to June 19, 2047; scope of business: real estate brokerage services; marketing planning; advertising graphic design; interior decoration. (for projects that must be approv...
problem description I just want to simply use php to implement non-blocking tasks https: github.com reactphp what I want to implement is that there are some tasks in function,function in do. After careful consideration, it should not be possible ...
needs to match all values, including integers, decimals, and scientific counts. For example, + 100 ", " 5e2 ", "-123 ", "3.1416 " and "- 1E-16 " all represent numeric values. I don t know how to write regular expressions. ...
when the user submits the submit, the loading layer pops up, but the request server needs time to respond. At this time, the loading layer is still on the page and does not look very beautiful. Is there any way to prohibit the user from going back ?...
when res.body is undefined through the query, it is because body-parser is not loaded, but I do not have such a problem, but I also return undefined. What the heck is it? server.js body-parser const express = require( express ); const mongoose = ...
The project is based on the background management developed by vue, which needs to be controlled by permission classes. The backend says that he will control it. The login has the route requested from the page that can be accessed according to the accou...