I have the following line:
http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=1|4093F6|FFFFFF
I would like to find chld=1.
chld=1
1 can be any number, and I need to change it.
1
How can I find chld=xwhere xany number stands for?
chld=x
x
Here is a possible way:
var re = /chld=\d+/; var str = '"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=1|4093F6|FFFFFF"'; document.getElementById("res").innerHTML = str.replace(re, "chld=100");
<div id="res"/>
A regex chld=\d+that is very simple:
chld=\d+
chld=
\d+
chld s, , g var re = /chld=\d+/g;. \d [0-9]: var re = /chld=[0-9]+/g;. JavaScript \d [0-9] :
chld
g
var re = /chld=\d+/g;
\d
[0-9]
var re = /chld=[0-9]+/g;
, . \d [0-9]. Unicode, \d . Java, JavaScript PCRE. Unicode ASCII \d.
Source: https://habr.com/ru/post/1589457/More articles:Что означает `Vec`? - rustEquivalent to document.getElementsByClassName - ocamlHow can I use the signature of the Task.Run method (Func f)? - c #Using git-flow, how to work with swapping into a mix - githttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1589456/how-to-add-a-folder-of-a-repository-as-a-submodule-to-other-repository-using-tortoisegit&usg=ALkJrhgfeAcJzaiYnmET_k_dJbMgmrQakARuby: Подождите, пока все потоки будут завершены с помощью join и ThreadsWait.all_waits - какая разница? - multithreadingIs a decorator template the right choice here? - c ++A list of C ++ initializers with complex structures - c ++Как скрыть один поддокумент в конвейере агрегации MongoDB? - mongodbDeploying a local Docker image (DockerFIle) as a local Kubernetes module - dockerAll Articles