使用正则表达式在等号后显示文本?

Sha*_*313 4 javascript regex

我想知道是否有一个代码,更好的Regexp,可以在等号后得到所有文本.

例如:

3 + 4 = 7

结果:

7

这甚至可能吗?我希望如此,先谢谢.

Joã*_*lva 7

var s = "3+4=7"; 
var regex = /=(.+)/; // match '=' and capture everything that follows
var matches = s.match(regex);
if (matches) {
    var match = matches[1];  // captured group, in this case, '7'
    document.write(match);
}
Run Code Online (Sandbox Code Playgroud)

jsfiddle中的工作示例.