TRIM STRINGS

Hi , I need to extract the this pattern of values from the below string -CVE-XXXX-XXXX . How do i achieve it using trim functionlality/ regex? for eg ih the first eg below- I need to extract only CVE-2010-4478

“CVE-2010-4478” 7.5 https://EDDW
"CVE-2016-10708 5.0 https://WEFW
"
"CVE-2017-15906 5.0 https://SFEWF
"
"CVE-2018-15473 5.0 https://SDSC
"
"CVE-2010-4755 4.0 https://SCSRC
"
“_ CVE-2008-5161 2.6 https://SCC
23/tcp open telnet”

Buddy if this is the string
in_string = “CVE-2010-4478” 7.5 https://EDDW

you can get like
out_string = split(in_string," ")(0).ToString

This would work buddy
Cheers

1 Like

Use **For Each ** activity and then use the below condition in the in clause.

Regex.Matches(strText, "(CVE-/d{4}-/d+)")

Then use the value inside the foreach as

matchy.value.tostring

If have to do in VB.net

For Each match As Match In Regex.Matches(data, "(CVE-/d{4}-/d+)")
Magic(match.Value)
Next
1 Like

Thanks Palaniyappan, it worked

1 Like

Cheers buddy
@shreyaank

Keep going

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.