Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Matching Operators

Matching Operators

  • Further, the "//" operator can be modified to include complex pattern matching routines. For example, the period (.) matching operator is used to stand for "any" character. Thus, "/eri./" would match any occurrences of "eric" as well as "erik".

  • Another commonly used matching operator is the asterisk (*). The asterisk matches zero or more occurrences of the character preceding it. Thus, "/e*ric/" matches occurrences of "eeeeeric" as well as "eric".

  • The following table includes a list of useful matching operators.

Operator Description
\n New line
\r Carriage Return
\t Tab
\d Digit (same as [0-9])
\D Any non-digit (same as [^0-9])
\w A Word Character (same as [0-9a-zA-Z_])
\W A Non-word character
\s Any white space character (\t, \n, \r, or \f)
\S A non-white space character
* Zero or more occurrences of the preceding character
+ One or more occurrences of the preceding character
. Any character
? Zero or one occurrences of the preceding character

Additional Resources:

Pattern matching with "//"
Table of Contents
Anchors


Up to => Home / Authoring / Scripting / Tutorial




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers