(? < = / / |) (\ w) +\.) +\ w+) (\: (\ d +)) how to understand this rule

(? < = / / |) (w) +.) + w +) (: (d +)) how to understand this rule
Mar.31,2021

this regular wants to match the URL, similar to this one (with domain name and port number) http://second.www.baidu.com:8080 and second.www.baidu.com:8080 , take the part after or after the beginning of / / . There is something wrong with the regular writing of
. The intention of / / should be changed to \ /\ / after adding escape characters, and the intention of (\ w) + should be written as \ w + .

rewrote (? < =\ /\ / | ^) ((\ w +\.) (\: (\ d +))

explain in segments:

  1. (? < =\ /\ / ^) requires that the matching target must be preceded by / / or the matching target must be at the front.
  2. (\ w +\.) +\ w + match text. one or more + text, such as abcd.efgh abcd.efgh.izk abcd.efgh.izk.sfds can be matched, abcd cannot be matched alone
  3. \: (\ d+) match : multiple digits , that is, port number
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38901-2c11d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38901-2c11d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?