I want to check if a string ends with
- v{number}
So for example
hello world false
hello world - v2 true
hello world - v false
hello world - v88 true
Not entirely sure how to go about doing this RegEx.
var str = 'hello world - v1';
var patt = new RegExp("/^ - v\d*$/");
var res = patt.test(str);
console.log(res);
How could I fix the above RegEx?