Jump to content
UBot Underground

Remove text from list using regex


Recommended Posts

hello guys

i want ask something, i have list there are :

 

Buy cheap medicine online

buy medicine

best medicine

weight loss capsule

weight loss tips

buy cheap capsule

buy new car 2014

 

then i will remove sentence contains medicine and weight loss. and the result are:

 

buy cheap capsule

buy new car 2014

 

and my question is how to remove sentence contains medicine and weight loss using regex?

 

please answer my question

 

thanks for your help

Link to post
Share on other sites


Clean_List()
define Clean_List {
clear list(%List)
add list to list(%List, $list from text("Buy cheap
medicine online
buy medicine
best medicine
weight loss capsule
weight loss tips
buy cheap capsule
buy new car 2014", $new line), "Delete", "Global")
set(#Replace, $replace regular expression(%List,
"(.*)weight(.*)|(.*)medicine(.*)", $nothing), "Global")
clear list(%List)
add list to list(%List, $list from text(#Replace, $new
line), "Delete", "Global")
set(#Replace, $nothing, "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...