Let's begin by saying that I'm an beginner, so my methods of using Regex is rather primitive, and there's more than one way to do it! (Perl philosophy!)
(You may ask yourself, why don't I just parse the string myself? Well, one is because it's easy to make a mistake, two is that usually regular expressions are compiled and optimized, so it's faster.)
So let's start with the definition:
A regular expression is a pattern of text in regular language. It describes what to match in a regular string. It serves as a filter to find what you're looking for.
Regular expressions are somewhat standardized - they're consistent with the different languages, despite the different syntax to call them.
The two main function of using regular expression is to match and to replace. The former determines if the pattern is in the string, and if so, find it. Replace changes the string according to the pattern to another pattern.
Sunday, February 28, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment