Derek++ 0 Posted February 8, 2014 Report Share Posted February 8, 2014 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? Quote Link to post Share on other sites
ds062692 19 Posted February 8, 2014 Report Share Posted February 8, 2014 Why don't you use find regular expression instead of replace regular expression? In this case find regex is much more convenient. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 8, 2014 Report Share Posted February 8, 2014 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") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.