Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
100. 101. 102.
伙计们,这是我的文字,我想这样改变:
<tag>100.</tag> <tag>101.</tag> <tag>102.</tag>
我的正则表达式是:
[0-9][0-9][0-9]\.
用。。。来代替:
<tag>\1</tag>
但它不起作用:(我看不到数字和点号。
提前致谢
你需要一些(捕获)括号;
回复: (\d{3}\.) 更换<tag>\1</tag>
(\d{3}\.)
您缺少\.括号中的。试试这个$regex = ":[\d\.]+:"。
\.
$regex = ":[\d\.]+:"