$list replace

Allows you to replace by text or regex within a list.


Example

Running this code will put the following texts to the list named "%test":

John exercises 1 time a week "rarely"
Tom exercises 3 times a week "occasionally"
Bob exercises 5 times a week "regularly"

Running this code will apply the expression:

(?<=exercises).*

as shown on the alert box.

Running this code will apply the expression:

(.?exercises | time.)

as shown on the alert box.

Running this code will apply the expression:

.*

as shown on the alert box.

add list to list(%MyList,$list from text("John exercises 1 time a week \"rarely\"
Tom exercises 3 times a week \"occasionally\"
Bob exercises 5 times a week \"regularly\"",$new line),"Delete","Global")
alert($plugin function("Data and Files Automation.dll", "$list replace", %MyList, "(?<=exercises).*", "", "True", "-1"))
alert($plugin function("Data and Files Automation.dll", "$list replace", %MyList, "(.*?exercises | time.*)", "", "True", "-1"))
alert($plugin function("Data and Files Automation.dll", "$list replace", %MyList, " .*", "", "True", "-1"))

Was this helpful?

Previous Article

$list remove range

Next Article

$list reverse