Jump to content
UBot Underground

How to use replace regular expression with this?


Recommended Posts

Hi, i wonder how to use $replace regular expression for replace the following:

 

from:

 

abc

def

ghi

 

to:

 

abc,t

def,t

ghi,t

 

Thanks for help!

Link to post
Share on other sites

Here you go

clear list(%abc list)
add list to list(%abc list, $list from text("abc
def
ghi", "
"), "Delete", "Global")
loop($list total(%abc list)) {
   add item to list(%abc list edited, $replace regular expression($next list item(%abc list), "$", ",t"), "Delete", "Global")
}

Link to post
Share on other sites

thanks! But you use loop, is this the only way? how to replace multi-line one time with regular expressions?

Link to post
Share on other sites

Using a list you need a loop... you can try saving it as a #variable and try the same regex... not sure if it will work but it might be worth a shot...

Link to post
Share on other sites

thanks! But you use loop, is this the only way? how to replace multi-line one time with regular expressions?

 

To do it in one go, save the list to a variable and replace regular expression to the variable ;)

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