We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You must opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>GetRegularExpression (29 Aug 2004, PeterThoeny)
Tags:
create new tag
, view all tags

Implemented: New TWiki::Func::getRegularExpression Function to get Predefined Regular Expressions

getRegularExpression( $regexName ) ==> $pattern

Description: Retrieves a TWiki predefined regular expression
Parameter: $regexName Name of the regular expression to retrieve. See notes below
Return: String or precompiled regular expression matching as described below
Since: TWiki::Plugins::VERSION 1.020 (9 Feb 2004)

Notes: TWiki internally precompiles several regular expressions to represent various string entities in an I18N-compatible manner. Plugins are encouraged to use these in matching where appropriate. The following are guaranteed to be present; others may exist, but their use is unsupported and they may be removed in future TWiki versions. Those which are marked "CC" are for use within character classes and may not produce the desired results outside of them.

Name Matches CC
upperAlpha Upper case characters Y
lowerAlpha Lower case characters Y
mixedAlpha Alphabetic characters Y
mixedAlphaNum Alphanumeric charactecs Y
wikiWordRegex WikiWords N

Example:

   my $upper = TWiki::Func::getRegularExpression("upperAlpha");
   my $alpha = TWiki::Func::getRegularExpression("mixedAlpha");
   my $capitalized = qr/[$upper][$alpha]+/;

-- RichardDonkin - 09 Feb 2004

Discussions

Added docs of feature added on 09 Feb 2004 by RichardDonkin.

-- PeterThoeny - 29 Aug 2004

 
WebForm
TopicClassification FeatureDone
TopicSummary Plugins: New TWiki::Func::getRegularExpression Function to get Predefined Regular Expressions
InterestedParties

AssignedTo

AssignedToCore RichardDonkin
ScheduledFor CairoRelease
RelatedTopics

SpecProgress 100%
ImplProgress 100%
DocProgress 100%
Topic revision: r1 - 29 Aug 2004 - 07:45:01 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback