|contactCopy Online Help|
Text replacement rules
With text replacement rules, you can modify the original text
before it is processed by the contact data
Each text replacement rule consists of
RequirementsIf a rule should only be applied when copying information from specific web-sites or applications, you can specify that as a requirement for the rule.
Requirements of text replacement rules can use the following information:
Search patterns can be either strings or regular expressions.
Use the buttons Export or Import for exporting or
importing rules from/to a text file. The file format is a text file
with two values per line, separated by a Tab character (ASCII
Text replacement rules will be applied in the order in which they appear in the rule list. Use the Move up and Move down buttons to adjust the priority of a rule.
Regular expressionsIn addition to strings, ContactCopy supports regular expressions as search patterns in a text replacement rule.
ContactCopy uses regular expressions of the Perl type.
See the follwing pages for details on Perl regular expressions:
How to use text replacement rules - ExamplesExample 1:
CustFaxNo 212 555 5555
Fax 212 555 5555
"CustFaxNo" is used to label fax numbers, but ContactCopy does not recognize the label "CustFaxNo".
Create a rule that replaces the label CustFaxNo with the label Fax, which ContactCopy understands.
11 West 53rd Street, New York NY 10019 (Show address on map) Website: www.moma.org
11 West 53rd Street, New York NY 10019 Website: www.moma.org
When selecting contact information in an online address directory, a link named (Show address on map) is included in the selection. ContactCopy should ignore this string, instead of displaying the string as an "unrecognized item."
Create a rule that replaces the string (Show address on map) with an empty string (i.e. removes the string).
Phone 555 7890
Phone (212) 555 7890
In an address directory on http://www.abc.com, all phone numbers are specified without area codes.
But ContactCopy only recognizes phone numbers with area codes.
The area code to insert should be (212).
Insert the area code (212) between the string "Phone" and the phone number.
--> Create a rule that replaces the regular expression pattern
Phone (\d\d\d) (\d\d\d\d)
Phone (212) $1 $2
\d matches a digit
$1 will be replaced by the string matching the first sub-pattern between brackets, (\d\d\d),
$2 will be replaced by the string matching the second sub-pattern between brackets, (\d\d\d\d),
To make sure this rule is ONLY applied when copying from http://www.abc.com (as it might produce invalid results when copying from other sites), set the requirement "Source URL contains www.abc.com"