Jump to content
UBot Underground

Extracting price from text using regex replace


Recommended Posts

Hi,

 

I'm trying to extract the price from this text...

<span class="star"></span>  1973 Land Rover 88 NUT & BOLT RESTORATION - $65000 (PALM BEACH )</h2>

BTW "$" is the html escape code for the dollar sign. I'm using this code...

set(#price, $replace regular expression(#fulltitle, "^.+$([0-9]+).*$", "$1"), "Global")

Where #fulltitle is the input text from above.

 

The regex works perfectly in Editpad Lite but not in ubot. I have tried several different variations but nothing seems to work. Also if I just use a regex like this...

set(#price, $replace regular expression(#fulltitle, "^.*([0-9]+).*$", "$1"), "Global")

Then I will end up with only the last digit "0" instead of the whole group "65000". What am I doing wrong?

 

Link to post
Share on other sites

Need to use .net Regex

 

http://regexhero.net/tester/

 

works in version 4 sometimes five

 

set(#price$find regular expression("<span class=\"star\"></span>  1973 Land Rover 88 NUT & BOLT RESTORATION - $65000 (PALM BEACH )</h2>""(?<=$).*?(?=\\s)"), "Global")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...