Wild Cards


The Find dialog in the Visual 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 in Visual FoxPro]

If you tick the wildcards box then you can use the familiar '?' and '*' codes in your search as well as a few more from the world of regular expressions..

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.
[] a group of characters.

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 and 'B1' has just a single digit.
<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.

Access Tips

FoxPro Tips

General Tips

 

Related Items

Wild card searches in Microsoft Access

Wild cards make searches more powerful and flexible in Access

Read More

Search page for Alvechurch Data

Searching a web site with JavaScript

Read More

Search options in Microsoft Access

How to set the default search options in a Microsoft Access database

Read More