-
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? ...
-
/ ^ (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 ...
-
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 ...
-
How to write regular matching for such URL?
need to match:
https: www.example.com
https: www.example.com demo
https: www.example.com demo abc
https: www.example.com demo abc 123.html ()
mismatch:
https: www.example.com demo abc efg123.html
...
-
In Js, the value of the specified key in the cookie name is fetched with the rule.
1. The string in the cookie fetched by the foreground is a connection of multiple cookie, for example, these two types:
var str = "OnlineCookie=OnlineCookie&UserType=11111111111111111&UID=39&UserName=; UID=; UserType=; UserName=";...
-
How do regular expressions match / followed by numbers and letters?
MEDU1778421 FEJ7296886
FCIU2741867 FEJ7296887
GLDU9472098 FEJ7296888
I want to match the following numbers and replace them with spaces for example, how to match letters and spaces
MEDU1778421
FCIU2741867
GLDU9472098
...
-
How do I replace one of the matches when there are multiple regular matches?
as shown in the figure: I use str.replace ( (null) , "jsonCallBack "); can only replace the first null, , but what should I do to replace the third?
the following is the string "< input type= " radio "name= " p_date_type_sl_sl_sl "value= " i...
-
The problem of regular expressions
var newsname; ctrl.checkNameLegal = function () { if (ctrl.fileName) {
var exports = ^(?![.])[ u4e00- u9fa5_.a-zA-Z0-9]+$ ig;
if (exports.test(ctrl.fileName)) {
newsname = ctrl.fileName;
} else {
ctrl.fileName = newsname;
}
} else {
newsname = ...
-
How do you regularly match to 12-128, but not to the first two digits 12 of 129?
when trying to use regular matching 12-128, it is found that it can match to 129, such as the question.
192.168.0.(12[0-8]|1[0-1][0-9]|[2-9][0-9]|1[2-9])
True is returned when matches 129. judgment 255 will also match the first two digits 25.
h...
-
How to write regular: add a space every 4 digits and be able to delete spaces?
1. Requirements: write a regular 2 that can automatically add a space for every 4 digits written. Problem: the regular (or incorrect) is written out, but the spaces cannot be deleted! 3. Picture
4. Code innput listening:
`$("ul.information-...
-
Ask for a rule! Get the number and process it, and then replace the original number.
const datas =[
"https: img.codeshelper.com upload img 2021 03 09 1tcsu5c0vun5800.png",
"https: img.codeshelper.com upload img 2021 03 09 mc3p5hxjed25801.png",
"https: img.codeshelper.com upload img 2021 03 09 b0sxs...
-
Match two comments and the content between them, how to write the rule?
*start*
import aaa ;
*end*
let a={
b: c
*start*
d: e
*end*
}
now you want to match all the content from * start* to * end* , and replace it with ", , that is, all that s left in the above code is: .
let a={
b:...
-
Regular Filter tag and retain the attributes inside the tag
A HTML in a text box contains text and img tags for example
<img src=".. .. static images express 4.gif" alt="[em_4]"><img src=".. .. static images express 4.gif" alt="[em_4]">
make Filter look like...
-
The problem of regular expressions matching url
the following regular expression can successfully configure key, (^ |) in url. Doesn t it mean start or empty? how can it match & what s wrong with it? regular
?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=%E6%AD%A3%E5%88%99%E8%A1...
-
A small problem with the g parameter of js regular expression
as shown in the figure above: in the first way, the $3.23 is identified as false , but in the second way, only one parameter g is removed and passed. According to principle, the first one should also be passed, please give us guidance!
...
-
How does JS regular HTML tag in Filter ()?
example:
(999 < video > < video > )
I want to delete the p tag in parentheses ().
...
-
The NBT_USDT, regular representation returns the content before the underscore.
find the underscore through the regular expression, return the previous content, and don t want anything else. ...
-
How to use a regular check password that can only have numbers or letters or numbers plus letters?
password requires 1, number 2, letter 3, number + letter ...
-
A strange question of regular matching?
Code first:
if( ( module (?:.+[^ .html])) .test(". src module comment details.html")){
console.log(RegExp.$1) module comment details
}
if( ( module (?:.+[^ .js])) .test(". src module comment details.js")){
console...
-
How do js regular expressions match and replace text using the replace method?
for example: abdsdsdfsdf1526614206112164350fskdfskdf1526614199681037404bcmvbcvbmcnvz: match 1526614206112164350 and 1526614199681037404 in the string, add quotation marks on both sides, and process it as follows: abdsdsdfsdf "1526614206112164350 " fskdf...