create new tag
, view all tags
Regular expressions can be complicated to understand, especially if you are just learning them (as I am). I am starting a series of pages on WikiLearn explaining some regular expressions, as I or others find the need.

For some people, this may be all they ever need to know about regular expressions (in other words, that they can find an explanation for a particular regular expression that they would like to understand).

For others, reading these pages may be helpful in learning to read regular expressions just like their native spoken language, but it is probably not the only resource required (or the most efficient way) to learn to read and write regexes. (I do have some other resources related to using regexes in Perl on my home TWiki which I will eventually move to WikiLearn, but you probably need to read some good tutorials / references on regular expressions. What I've learned so far about regexes has come from skimming / using some O'Reilly books on Perl, particularly those on the O'Reilly Perl Bookshelf CD.

My intent is to cover most regular expressions that I (or others) "deconstruct" on a separate WikiLearn page, and prefix each page name with RegexExp (for Regular expression Explanation).

Aside: To add additional RegexExp pages, simply create a new page with a name starting with "RegexExp...". It is suggested that you included the actual regular explanation in the first 160 characters as it will then appear in the summary (on this page).

For regular expressions from the TWiki code, I am including the word "TWiki" immediately after the RegexExp prefix, and then trying to provide a name that mentions where the regex is used. For example, RegexExpTWikiExtractNameValuePair describes two regular expressions found in sub extractNameValuePair in TWiki.pm of the 01 December 2001 TWiki release. Note: "TWiki" in the page name is intended as a reference to the TWiki application, not to the Perl module (file) TWiki.pm.

Two notes about the following search:

  • I added a [^l] after ^RegexExp to exclude some moved pages that were originally prefixed with "RegexExplanation". Someday those pages should probably be deleted and the [^l] deleted from the pattern.
  • I tried adding [^a-z] after ^RegexExp to exclude any page with a lowercase letter after "RegexExp", but that didn't work -- it didn't find anything, specifically pages with an uppercase letter after "RegexExp" -- I don't know if I did something wrong or if this is another TWiki anomaly.

  • Topic: Summary

  • RegexExpFilterHiddenFiles: $incfile ~ s/(^ \/)\./$1/g; This came from Codev.TopicsWithPasswdInNameCannotBeIncluded . Here is how I analyze it: Oops: I thought, from the discussion in Codev...

  • RegexExpTWikiEndAnchorWorkaround: ^a zA Z0 9 is (was?) included in % SEARCH{ `^% TOPIC% ^a zA Z0 9 ` to limit matches to strings that match the complete search pattern and nothing more. In other...

  • RegexExpTWikiExtractNameValuePair: if( ( $str ~ /(^ ^\S )$name\s \s \`( ^\` )\`/ ) ( $2 ) ) { and if( ( $str ~ /(^ \ \s \` ^\` \`)\s \`( ^\` )\`/ ) ( $2 ) ) { elsif( ( $str ~ /^\s \w...

<Currently, no significant content below this line.>




See Regular Expression


  • () RandyKramer - 19 May 2002
  • <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>

Page Ratings

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2003-07-15 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look