I need is the last match. In the case below the word
test without the
$ signs or any other special character:
$this$ $is$ $a$ $test$
$ represents the end of the string, so...
However, your test string seems to have dollar sign delimiters, so if those are always there, then you can use that instead of
var s = "$this$ $is$ $a$ $test$"; document.body.textContent = /\$(\w+)\$$/.exec(s);
If there could be trailing spaces, then add
\s* before the end.
And finally, if there could be other non-word stuff at the end, then use
- Same function for independent element
- Get child node index
- RegeX code for PowerShell Lookbehind not working matching on IP Addressing
- It's strange. It's a Function but can use same as Object
- react - get width/height of image to process
- Using a single handleInputChange method to for multiple input fields (React)