It is quite a common task, when someone needs to update bulk of files using update rules. To do so, you have to write program, where you define your logic of update.
EZY Prolog has primitive and powerful language for conditional replacement of the strings and this language consist of only 7 declarations. Conditional string replacement can be programmed via nested declarations.
In general, system uses the following logic for string replacement:
get update rule from the
list and if it is valid
- continue with replacement rules inside this rule.
System
will continue with rest of the string.
if previous rule failed - continue with the rest of replacement rules.
What you can do inside replacement rule:
find string and replace it with given string. If successful - continue with text after found string.
check if there given string doesn't exist. If successful - continue with next list of replacement rules
find string, insert given string before found. If successful - continue with text after found string.
find string, insert given string after found. If successful - continue with text after found string.
find any string from the list and replace. If successful - continue with text after found string.
find string and replace. If successful - continue with text after found string.
Generally speaking, this set of domains defines the algorithm of how text will be replaced by calling one ezy_replace_string function.
Text replacement algorithm can be defined via set of replacement rules which allows conditional search and replace operations inside text strings.
For more information - please see replacement rules.
Copyright 1998-2002 EDMGROUP (Australia)
Last Updated: July 29, 2002