简体   繁体   English

JavaScript正则表达式:字符串开头和字符串结尾

[英]JavaScript Regex: Start of String AND End of String

In JavaScript, I want to find all instances of text in the HTML that: start with (( and end with )). 在JavaScript中,我想找到HTML中所有文本实例:以(((和)结束)。 Here is what i currently have: 这是我目前拥有的:

/^\(\(([a-zA-Z0-9\s\?\&\=\#\.\_\/\-\%\\]{1,})\)\)$/;

But it's not working. 但这不起作用。

How would i implement this? 我将如何实施呢? Thanks! 谢谢!

Try this regular expression: 试试这个正则表达式:

var regExDoubleParentheses = /\(\(.*?\)\)/g;

You can test it out here . 您可以在这里进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM