Jump to content
UBot Underground

ReGex to Remove price from Title text


Recommended Posts

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 

Link to post
Share on other sites
  • 2 weeks later...

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 new
tv for
at mysite
 
Does someone know why that happens?
 
Thanks
Dan
Link to post
Share on other sites
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

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...