Full Text Searches and Replacing |
To perform full-text searching use the Edit > Find (F3) command and in the Find field of the displayed Find & Replace toolbar enter the data pattern or plain substring to look for.
The Find Previous/Next commands simply scroll to the subsequent found table or form cell values. The Find All command performs full-text filtering of Text and Numeric fields (Long Text fields are not included).
Depending on which view is currently active (a table, form or a memo/object field), the searching procedure can concern:
There are three search modes that can be specified using the Options button menu:
Regular Expressions - the Find string is a data pattern based on standard regular expression syntax. Some examples of regular expressions:
abc - matches substrings "abc",
.bc - matches three character substrings consisting of any character followed by "bc",
\Aabc - matches field contents starting with "abc",
abc\z - matches field contents ending with "abc",
\Aabc.*123\z - matches field contents starting with "abc" and ending with "123" with any number of other characters in between,
abc\d\z - matches substrings ending with "abc" and one digit,
^a\d+ - matches field contents containing a line starting with "a" and at least one digit,
^a\d* - matches field contents containing a line starting with "a" and zero or more digits,
[ab]+c - matches substrings "abc", "aabc", "abbabc" etc. and not "c",
[ab]*c - matches substrings "abc", "aabc", "abbabc" etc. and "c",
[^ab]+c - matches substrings ending with "c" and not containing "a" or "b",
\w\d{2,3} - matches substrings consisting of one letter followed by 2 or 3 digits,
\Aab\d{2,3}c - matches field contents beginning with "ab", two or three digits and "c",
abc|xyz - matches field contents contaning "abc" or "xyz" - logical OR,
(?=.*abc)(?=.*xyz) - matches field contents contaning "abc" and "xyz" - logical AND,
\A\z - matches empty fields,
For more information, see PCRE regular expression syntax summary
The Replace string can contain:
(1) absolute references (by number) to capturing subpatterns, eg. \1, \2...
a capturing subpattern (or a "group") is a part of the pattern enclosed in () parenthesis.
(2) \l, \L, \u, \U literals to (binary) switch upper- and lower-case conversion
(3) \r, \n - 'line feed' and 'new line' literals (by default, Alt+Enter & Ctrl+Enter insert the \n character into the text field).
(4) \s - a single space character.
Note: to find and replace Unicode/non-ascii characters, use Unicode reg. expressions,
e.g. \p{L} instead of \w, \P{L} instead of \W etc.
Examples:
Find pattern: | cat |
Replace string: | dog |
Result: | replaces "cat" with "dog" |
Find pattern: | \\ |
Replace string: | / |
Result: | replaces the "\" characters with "/" |
Find pattern: | \A\z |
Replace string: | NULL |
Result: | fills empty fields with sthe "NULL" strings |
Find pattern: | \ANULL\z |
Replace string: | |
Result: | if a field contains only the "NULL" string, deletes its contents |
Find pattern: | \b(\w+)(?:\W+\1\b)+ |
Replace string: | \1 |
Result: | removes duplicate words in fields |
Find pattern: | (\b\w)(\w*(\W+|\z)) |
Replace string: | \u\1\l\2 |
Result: | converts first letters in words to uppercase, other to lowercase |
Find pattern: | (\b\w)(\w*(\W+|\z)) |
Replace string: | \1 |
Result: | creates abbreviations consisting of first letters of words |
Find pattern: | (\b\w(\d*))(\w*(\W+|\z)) |
Replace string: | \1 |
Result: | creates abbreviations consisting of first letters of words, leaves full numbers |
Find pattern: | (\S*)(\s*)(\S*)(\s*)(\S*) |
Replace string: | \g5\g4\g3\g2\g1 |
Result: | reverses the order of up to first 3 words in fields |
Find pattern: | \R |
Replace string: | \s |
Result: | replaces line-breaks with spaces |
Find pattern: | ab+ |
Database field content: | abcdefaabb |
Replace string: | x |
Replacement result: | xcdefax |
Find pattern: | (.)a+\d{1,3} |
Database field content: | abc aa0102 |
Replace string: | \1 |
Replacement result: | abc 2 |
Find pattern: | (ab) |
Database field content: | abcdef ghijk abb123 |
Replace string: | \u\1\l\1xyz\s |
Replacement result: | ABabxyz cdef ghijk ABabxyz b123 |
Find pattern: | \R |
Database field content: | abc def ghi |
Replace string: | \s |
Replacement result: | abc def ghi |
If the full text searching is performed for a single memo field data, the search mode automatically defaults to the Plain Text - Partial Matching search mode.
The "Scripts" button on the "Find & Replace" toolbar can be used to performed quick mass text replacing in a given table.