chowhan 0 Posted December 13, 2013 Report Share Posted December 13, 2013 Hi everyone, i was looking for a regex string remove a word from text line. I have this : Buy new tv for 4000€ at mysite need to remove the price which vary everytime with its always with € sign output should look like this Buy new tv at mysite Please if someone can help, thanks Quote Link to post Share on other sites
pftg4 102 Posted December 13, 2013 Report Share Posted December 13, 2013 is the length of the amount different all the time or the same pftg4 Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted December 13, 2013 Report Share Posted December 13, 2013 set(#text, "Buy new tv for 4000€ at mysite", "Global") set(#text, $replace regular expression(#text, "[0-9]\{1,7\}€\\s", ""), "Global") alert(#text) 1 Quote Link to post Share on other sites
chowhan 0 Posted December 22, 2013 Author Report Share Posted December 22, 2013 set(#text, "Buy new tv for 4000€ at mysite", "Global") set(#text, $replace regular expression(#text, "[0-9]\{1,7\}€\\s", ""), "Global") alert(#text) thanks, that worked. cheers Quote Link to post Share on other sites
Bot-Factory 602 Posted December 28, 2013 Report Share Posted December 28, 2013 Hi. To learn Regex, I try to reproduce a lot of the examples here in the forum. I tried this the other way around: set(#text, "Buy new tv for 4000€ at mysite", "Global")set(#text, $find regular expression(#text, "[a-zA-Z]+[^0-9+€][a-zA-Z]+"), "Global")alert(#text) But my result has some <CR> in it: Buy newtv forat mysite Does someone know why that happens? ThanksDan Quote Link to post Share on other sites
Bot-Factory 602 Posted December 28, 2013 Report Share Posted December 28, 2013 set(#text, "Buy new tv for 4000€ at mysite", "Global") set(#text, $replace regular expression(#text, "[0-9]\{1,7\}€\\s", ""), "Global") alert(#text) Wouldn't it be possible to just use:[0-9]+€ Dan 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.