^(?: (?=$))?$ 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...
I want to save it directly when I click on the tick after editing the cell. Could you tell me how to change it? Baidu s use of onEditableSave didn t work either. <td class="role_edit" data-type="checklist" id="role_edi...
as there are more and more routes, more and more components are introduced into router.js, and each particular page corresponds to a different component. is this a reasonable way to write? It feels weird ...
first of all, let s talk about my requirements: draw dots and edges in a web page (the number of edges is much larger than points, for example, there are 10,000 dots, hundreds of thousands of edges) is drawn using webgl. After a series of optimizat...
Clicking when selected is the current item will not jump, nor will it trigger an event. The requirement is how to jump to the home page routing after going to the child page of the home page when the selected is still the home page? Thank you all. <...
the connection to the official account of Wechat on the windows server has been prompting that the service provided by the official account has failed try to transfer the server to the virtual space of linux for debugging. Everything is normal, and yo...