| Using Regular Expressions with VFP, with an XMLHTTP Bonus! |
The Atlanta FoxPro Users Group - April,
2004
Regular Expressions represent a technology that too few FoxPro developers take advantage of. This presentation will
focus on a fast track to make full use of this powerful functionality. |
|
"Never express yourself more clearly than you are able to think." -- Niels Bohr
|
Regular expressions figure into all kinds of text-manipulation tasks.
Searching and search-and-replace are among the more common uses, but regular expressions can also be used to test for
certain conditions in a text file or data stream. You might use regular expressions, for example, as the basis for a
short program that separates incoming mail from incoming spam. In this case, the program might use a regular
expression to determine whether the name of a known spammer appeared in the "From:" line of the email. Email filtering
programs, in fact, very often use regular expressions for exactly this type of operation.
Regular expressions trace back to the work of an American mathematician by the name of Stephen Kleene (one of the
most influential figures in the development of theoretical computer science) who developed regular expressions as a
notation for describing what he called "the algebra of regular sets." His work eventually found its way into some
early efforts with computational search algorithms, and from there to some of the earliest text-manipulation tools on
the Unix platform (including ed and grep). In the context of computer searches, the "*" is formally known as a "Kleene
star."
Regular expressions tend to be easier to write than they are to read. This is less of a problem if you are the only
one who ever needs to maintain the program (or sed routine, or shell script, or what have you), but if several people
need to watch over it, the syntax can turn into more of a hindrance than an aid.
|
| Downloads |
|
|
| Links |
|
|
|
|
|