I have a string that I am getting dynamically from URL which looks as follows
Text from Link: "MD Sheet Template v4.4.0 2023 11 01 (please share then)"
from the above text, I want to get the following.
1. Version
- v4.4.0
2. Date
- 2023 11 01
I tried it like this
let text = "MD Sheet Template v4.4.0 2023 11 01 (please share then)";
let version;
let date;
version = text.match(/\.(.*?)\v3/i);
console.log('version', version); // null
date = text.match(/\.(.*?)\20/i);
console.log('date', date); // null
How do I solve this issue?