I would like to know if there is a code, preferable Regexp, that can get all the text after an equal sign.
For example:
3+4=7
Results:
7
Is this even possible? I hope so, thanks in advance.
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);
}
Working example in jsfiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With