On Jan 28, 2006, at 12:17 PM, Phil M wrote:

What call is used to search for a string within a string?

I've poured over the Language Reference and seem to have missed it using Find and Match as search criteria.

InStr or InStrB (depending if you want to look for characters or bytes).

There is also RegEx, which allows you to search for strings based on patterns.

For example if you wanted to find a specific telephone number "800-491-5941" you would use InStr. But if you wanted to find all telephone numbers regardless of the number values you would use a RegEx pattern something like this:

    "\d\d\d[-]\d\d\d[-]\d\d\d\d"

Another example of RegEx is if you wanted to find "apple" but exclude words that have apple in them like "pineapple" and "snapple". Then you would use a search pattern like this:

    "\bapple\b"    // \b is a word boundary

RegEx is much more flexible than InStr, but it can also be a lot slower.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to