Regular Expression

From TBwiki
(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
 
<pre>/.*\.txt$/
 
<pre>/.*\.txt$/
 
</pre>  
 
</pre>  
This section provides a quick reference.
+
This section provides a quick reference.  
  
 
= Definition<br>  =
 
= Definition<br>  =
Line 26: Line 26:
 
= Toolpack and regular expressions  =
 
= Toolpack and regular expressions  =
  
Toolpack makes use of Perl-derivative regular expressions.  
+
[[Toolpack Application:gateway]]&nbsp;makes use of Perl-derivative regular expressions for route matching and digit remapping.[[Toolpack_v2.2:Creating_Called_Number_Routes|Toolpack_v2.2:Creating_Called_Number_Routes]]
  
 
Use for routing ... PCRE<br>  
 
Use for routing ... PCRE<br>  
Line 32: Line 32:
 
Use by script routing ... Ruby[http://en.wikipedia.org/wiki/Regular_expression <br>]  
 
Use by script routing ... Ruby[http://en.wikipedia.org/wiki/Regular_expression <br>]  
  
 +
<br>
  
 +
= References  =
  
= External References =
+
== Internal ==
  
[http://en.wikipedia.org/wiki/Regular_expression Regular Expression on Wikipedia]  
+
[[Web Portal Tutorial Guide Versions]]  
  
[http://www.regular-expressions.info/quickstart.html www.regular-expressions.info/quickstart.html]
+
[[Toolpack v2.2:Creating Called Number Routes]]  
  
 +
[[Toolpack v2.3:Creating Called Number Routes]]
 +
 +
<br>
 +
 +
== External  ==
 +
 +
[http://en.wikipedia.org/wiki/Regular_expression Regular Expression on Wikipedia]
  
 +
[http://www.regular-expressions.info/quickstart.html www.regular-expressions.info/quickstart.html]
  
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Revision as of 15:04, 26 January 2010

Contents

Introduction

Regular expressions, also referred to as regex or regexp, provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A regular expression is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.

Regular expressions are extensively used in computing and is really powerful. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager, the equivalent regex would be :

/.*\.txt$/

This section provides a quick reference.

Definition

Regular expressions is the term used for a codified method of searching invented or defined by the American mathematician Stephen Kleene.

POSIX definition

Traditional Unix regular expression syntax followed common conventions but often differed from tool to tool. The IEEE POSIX 1003.2 Basic Regular Expressions (BRE) standard (released alongside an alternative flavor called Extended Regular Expressions or ERE) was designed mostly for backward compatibility with the traditional (Simple Regular Expression) syntax but provided a common standard which has since been adopted as the default syntax of many Unix regular expression tools, though there is often some variation or additional features.

Perl-derivative

Perl has a more consistent and richer syntax than the POSIX basic (BRE) and extended (ERE) regular expression standards. An example of its consistency is that \ always escapes a non-alphanumeric character. Another example of functionality possible with Perl but not POSIX-compliant regular expressions is the concept of lazy quantification (see the next section).

Due largely to its expressive power, many other utilities and programming languages have adopted syntax similar to Perl's — for example, Java, JavaScript, PCRE, Python, Ruby, Microsoft's .NET Framework, and the W3C's XML Schema all use regular expression syntax similar to Perl's.


Toolpack and regular expressions

Toolpack Application:gateway makes use of Perl-derivative regular expressions for route matching and digit remapping.Toolpack_v2.2:Creating_Called_Number_Routes

Use for routing ... PCRE

Use by script routing ... Ruby


References

Internal

Web Portal Tutorial Guide Versions

Toolpack v2.2:Creating Called Number Routes

Toolpack v2.3:Creating Called Number Routes


External

Regular Expression on Wikipedia

www.regular-expressions.info/quickstart.html

Personal tools