- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 03:16 AM
Hi Developers,
I have this string
var a = "Remediation Task: VUL0011234 requesting Closed, False Positive state";
I want only Number i have used split but i am getting some , as well.
Please someone help me get only number from above string.
Much thanks in advance.
Regards,
G
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 03:32 AM - edited 10-17-2022 03:37 AM
Try with this regex [A-Z]{3}\d{7}. Script would look something like below.
var a = "Remediation Task: VUL0011234 requesting Closed, False Positive state";
var number = a.match(/[A-Z]{3}\d{7}/g); // g is used to find multiple matches.
//var number = a.match(/[A-Z]{3}\d{7}/); // remove g to find first matche found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 03:32 AM - edited 10-17-2022 03:37 AM
Try with this regex [A-Z]{3}\d{7}. Script would look something like below.
var a = "Remediation Task: VUL0011234 requesting Closed, False Positive state";
var number = a.match(/[A-Z]{3}\d{7}/g); // g is used to find multiple matches.
//var number = a.match(/[A-Z]{3}\d{7}/); // remove g to find first matche found.