Extract specific parts of text -- regex

Hello everyone, I need to extract the prices that are shown in the texts that the wizard processes. example:

Computer PC Gamer Amd Ryzen 5
3400G SSD 480GB+HHD 1TB Ram 16Gb
monitor 22"
Brand Amd * kkk kk 1 review

  • 46%
    $3,539,900
    $3,479,900 AXLES
    Accumulate up to 3,479 CMR Points (7)
    Or Free Shipping
    Receive it from November 23 to 24 in Usaquen
    Calculate shipping to another address
    1 NA Add to cart

I would need to extract
$3,539,900
$3,479,900

HI @Juan_Esteban_Valencia

You can try with this regex expression

System.Text.RegularExpressions.Regex.Matches(YourString,"^\W[\d.,]+")(0)
System.Text.RegularExpressions.Regex.Matches(YourString,"^\W[\d.,]+")(1)

Regards
Gokul

HI @Juan_Esteban_Valencia

Just you can try with another expression

System.Text.RegularExpressions.Regex.Matches(YourString,"^\$[\d.,]+")(0)
System.Text.RegularExpressions.Regex.Matches(YourString,"^\$[\d.,]+")(1)

Regards
Gokul

hi @Juan_Esteban_Valencia ,
you can try this expression

System.Text.RegularExpressions.Regex.Matches(YourString,“$\S*”)

Regards,

Hi,

Hope the following sample helps you.

mc = System.Text.RegularExpressions.Regex.Matches(yourString,"\p{Sc}[\d.,]+")

Sample20221123-3aL.zip (2.6 KB)

Regards,

Thank you very much for the prompt help!!
@Gokul001
@pranay.nandalaskar
@Yoichi

2 Likes

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