What are “regular expressions”?
Regular expressions are a way of describing a pattern – for example, “all the words that begin with the letter A” or “every 10-digit phone number” or even “Every sentence with two commas in it, and no capital letter Q”. Regular expressions (aka “regex”s) are useful in Apache because they let you apply certain attributes against collections of files or resources in very flexible ways – for example, all .gif and .jpg files under any “images” directory could be written as /\/images\/.*(jpg|gif)$/.The best overview around is probably the one which comes with Perl. We implement a simple subset of Perl’s regex support, but it’s still a good way to learn what they mean. You can start by going to the CPAN page on regular expressions, and branching out from there.
Regular expressions are constructs that look like comic-book expletives but can be wondrously powerful tools. Using Regular Expressions you can find (and replace) text that matches a certain pattern. Some characters have a special meaning: F.i. the character ? stands for “any (single) character”. So, if you wanted to find all four-letter words that begin and end with “t” (tart, text, tilt etc.) you would search for t??t. You can also tag expressions to reuse them. F.i., if you wanted to change all “\urls” into “\hrefs” , you would search for \\url\{\(0*\)\} and replace them with \\href\{mailto:\0\}\{\0\}. Note that the special characters (like “{” , “}” and “\” ) have to be escaped by a “\” to keep their literal meaning. The file %B\Doc\RegEx.txt will tell you more about WinEdt’s regular expressions.
Regular expressions are a way of describing a pattern – for example, “all the words that begin with the letter A” or “every 10-digit phone number” or even “Every sentence with two commas in it, and no capital letter Q”. Regular expressions (aka “regex”s) are useful in Apache because they let you apply certain attributes against collections of files or resources in very flexible ways – for example, all .gif and .jpg files under any “images” directory could be written as /\/images\/.*(jpg|gif)$/. The best overview around is probably the one which comes with Perl. We implement a simple subset of Perl’s regex support, but it’s still a good way to learn what they mean. You can start by going to the CPAN page on regular expressions, and branching out from there.
Regular expressions are a way of describing a pattern – for example, “all the words that begin with the letter A” or “every 10-digit phone number” or even “Every sentence with two commas in it, and no capital letter Q”. Regular expressions (aka “regexp”s) are useful in Apache because they let you apply certain attributes against collections of files or resources in very flexible ways – for example, all .gif and .jpg files under any “images” directory could be written as /.*\/images\/.*[jpg|gif]/.The best overview around is probably the one which comes with Perl. We implement a simple subset of Perl’s regexp support, but it’s still a good way to learn what they mean. You can start by going to the CPAN page on regular expressions, and branching out from there.
Regular expressions are a way of describing a pattern – for example, “all the words that begin with the letter A” or “every 10-digit phone number” or even “Every sentence with two commas in it, and no capital letter Q”. Regular expressions (aka “regex”s) are useful in Apache because they let you apply certain attributes against collections of files or resources in very flexible ways – for example, all .gif and .jpg files under any “images” directory could be written as /\/images\/.*(jpg|gif)$/.The best overview around is probably the one which comes with Perl. We implement a simple subset of Perl’s regex support, but it’s still a good way to learn what they mean. You can start by going to the CPAN page on regular expressions, and branching out from there.