[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
regular expression

Regular Expression

A regular expression is a pattern that can be matched against data (e.g. text) to see if it matches. Regular expressions can also capture data from what they are matching.

Examples of patterns include:-

  • \d+ matches one or more digits
  • \w matches one alphanumeric character *
  • (-?)([.\w]*)\(([+\-]?[.\w]*)x([.\w]*[+\-]?[.\w]*)\)\^([+\-]?[.\w]+) matches a mathematical function in the form (ax+b)^n
Perl is a language with a powerful implementation of regular expressions - see also a tutorial on pattern matching in Perl. (Some would argue that some patterns you can do in Perl are hardly regular though!).

* Though with the advent of unicode the definition of alphanumeric is somewhat changed.

last edited (July 9, 2003) by Jonathan, Number of views: 1606, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.