s c h e m a t i c s : c o o k b o o k

/ WebHome / TOC / Cookbook.PatternMatchingChapter

This Web


WebHome 
WebChanges 
TOC (with recipes)
NewRecipe 
WebTopicList 
WebStatistics 

Other Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
Sourceforge Page
SchemeWiki.org
Original Cookbook
RSS

Scheme Links


Schemers.org
Scheme FAQ
R5RS
SRFIs
Scheme Cross Reference
PLT Scheme SISC
Scheme48 SCM
MIT Scheme scsh
JScheme Kawa
Chicken Guile
Bigloo Tiny
Gambit LispMe
GaucheChez

Lambda the Ultimate
TWiki.org

Pattern Matching

Introduction

Lisps in general are sort of famous for looking down on Regular Expressions. Other languages that lack Scheme's powerful pattern matching tend to fall back on regular expressions to provide some of that capability; one could argue that Regular Expressions have been badly overused. For example, any sort of pattern matching that involves stack-like matching (matching parentheses, quoted strings, etc.) is usually very difficult using regular expressions.

Some people, when confronted with a problem, think "I know, Iíll use regular expressions." Now they have two problems. -- Jamie Zawinski

Still, Regular Expressions are unbeatable for a lot of text processing tasks. MzScheme provides built in regular expressions using the Unix egrep syntax. The pregexp.ss library also provides "Perl-like" regular expressions, which makes avalilable pretty much all of the Perl regex syntax.

Recipes

TOC: Cannot find topic "Cookbook.RegExpSplitInclusive" TOC: Cannot find topic "Cookbook.PattMatchMatchingLetters" TOC: Cannot find topic "Cookbook.PattMatchMatchingWords" TOC: Cannot find topic "Cookbook.PattMatchCommentRegExp"

References

Mastering Regular Expressions, written by Jeffrey Friedl and published by O'Reilly & Associates.

Regular Expressions - Chapter 10 in the MzScheme documentation


Comments about this recipe

In the original Cookbook there was a stub for pattern matching of the type provided by match.ss Should this sort of pattern matching be discussed here or in the IdiomChapter page? -- NoelWelsh - 19 May 2004

I think this page should be renamed StringPatternMatching? and the name PatternMatching? should be used for the discussion of pattern matching on Scheme values with the help of match.ss and plt-match.ss. A note refering to StringPatternMatching? and regular expressions would be a good idea.

-- JensAxelSoegaard - 19 May 2004

I think renaming this page to RegularExpressions? might make sense, since most people would recognize that and understand the context.

-- AntonVanStraaten - 31 May 2004

ToDo: create RecipeStubs for unlinked recipes above

Contributors

-- JensAxelSoegaard - 24 Apr 2004

-- GordonWeakliem - 28 Apr 2004

-- BrentAFulgham - 18 May 2004

CookbookForm
TopicType: Chapter
ParentTopic: TOC
TopicOrder: 11

 
 
Copyright © 2004 by the contributing authors. All material on the Schematics Cookbook web site is the property of the contributing authors.
The copyright for certain compilations of material taken from this website is held by the SchematicsEditorsGroup - see ContributorAgreement & LGPL.
Other than such compilations, this material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest