REGEX QUESTION - HOW TO FILTER MY STRING TEXT?

Hi there,

I need to use RegEx to manipulate a string,

Here is my initial string that I get from a scraping activity:

[12.11.20 15:05]
AGE ACTION (@ 0.6884)
Pular em 1 at 0.6864
Pular em 2 at 0.6864
Pular em 3 at 0.6864
Chutar at 0.6985

I need to remove some parts of the strings, as marked in red:

Kindly support me on this matter,
;D

Hi,

Can you try the following?

String.Join(vbcrlf,System.Text.RegularExpressions.Regex.Matches(yourString,"[A-Z\d\.@\(\)\s]+$",System.Text.RegularExpressions.RegexOptions.Multiline).Cast(Of Match).Select(Function(m) m.Value.Trim))

Regards,

1 Like

Hello Yoichi, thank you for answering my question,

Would you mind providing me a sample in which the given sentence is fully extracted by the regex?

Thank you :wink:

Hi,

Hope the following helps you,

Sample20210122-2.zip (2.3 KB)

It might be better to write full namespace for Match as the following, if you have an error at it.

String.Join(vbcrlf,System.Text.RegularExpressions.Regex.Matches(yourString,"[A-Z\d\.@\(\)\s]+$",System.Text.RegularExpressions.RegexOptions.Multiline).Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value.Trim))

Regards,