正则表达式:匹配除特定字符串以外的所有内容

RegEx: Match everything except a specific string

我有这么长的字符串,"The words Text and dots represent whole bunch of html code"

输入:

TextTextTextTextTextTextTextText....."signed_request" value="Random Value" />TextTextTextTextTextTextTextTextTextText.....

考虑到随机值,我如何匹配字符串 "signed_request" value="Random Value" 前后的所有文本而不是字符串本身 在引号之间, 所以它会输出

输出: TextTextTextTextTextTextTextText...../>TextTextTextTextTextTextTextTextTextText.....

试试这个正则表达式

/\s*\/>\w+|\w+(?="\S)/g

Check Here

感谢@dustmouse。