Wild Cards


The Find dialog in the FoxPro editor has a tick box labelled 'Use wildcards'. You are probably familiar with the '?' and '*' wild cards to match one character or many characters but FoxPro goes further than this.

[Find dialog]

If you tick the wildcards box then you can use the following codes in your search.

Wild Cards

Wild card Matches
? any single character except a NewLine.
* any number of characters - even zero.
# a single digit.
< the start of a word.
> the end of a word.

Examples

Example Matches
a?e 'are', 'database', 'A/e',
8?7 '1817', '8a7', and 'B48 7PQ' - remember that a space counts as a character.
a*e 'Alvechurch', 'database', and 'Mary had a little lamb' because * matches any number of characters - including one.
8*7 'SER#83/3471a', '1817', and '87' because * matches any number of characters - including no characters at all.
B## postcodes from 'B10' to 'B49' but not 'B1' because the expression specifies two digits.
<B any word starting with 'B' or 'b'.
#> any expression ending with a digit.

Groups

You can group characters together inside square brackets and search for an expression matching any one of these characters. A '!' before the group searches for any expression except one of the grouped characters.

Example Matches
[a-m] any character between 'a' and 'm' inclusive.
[123] any character matching '1', '2', or '3'.
[a-m].> any sentence ending with the letters 'a' to 'm' inclusive.
[!a-z].> any sentence ending with a non-alphabetical character.

Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map