MyTechSupport.ca :: Your Computer Technical Resource Headquarters! MyTechSupport.ca :: Your Computer Technical Resource Headquarters!
Home arrow Resources & Tools arrow Quick References arrow Regular Expression
Thursday, 21 November 2019
 
 
Main Menu
Home
Forums
Online Store
Web Directory
Affiliates
Sitemap
Featured Sites


Help Support Us!
Support MyTechSupport.ca in making a small donation:

Currency:

Regular Expressions

Basic Troubleshooting Steps Beep Codes
Computer Ports / Connectors  New Computer Security Threats  New
CPU Types and Specifications DVD Formats  New
File Extensions File Size Conversion Table
HTTP Status Messages IBM Diagnostic Codes
Linux Reference Guide  New Maximum Dedicated Bandwidths
Memory Styles and Types Modem AT Commands, S Registers and RS-232C pins
OSI Network Model Partition Size vs. Cluster Size
RAID Levels Explained  New Regular Expressions  New
Shortcut Keys Standard DMA, I/O and IRQ Assignments
TCP and UDP Port Numbers Technology Reference Cards
Windows XP TCP/IP Utilities - Netsh  New Wireless Networking Standards

SymbolDescriptionPatternPattern Matches
\ Indicates next character should not be interpreted literally if it normally is, and should be interpreted literally if it normally isn't a\sc a c
^ Matches beginning of input or line ^abc abc, abcdefg, abc123, ...
$ Matches end of input or line abc$ abc, endsinabc, 123abc, ...
* Matches 0 or more instances of preceding character ab*c ac, abc, abbc, abbbc, ...
+ Matches 1 or more instances of preceding character ab+c abc, abbc, abbbc, ...
? Matches 0 or 1 instances of preceding character ab?c ac, abc
. (period) Matches any single character other than the newline character a.c abc, aac, acc, adc, aec, ...
(x) Matches x and remembers the match (abc){2} abcabc
\n A reference to the last substring matching the nth parenthetical (where n is a positive integer). Backreferences allow you to reuse part of the regex match. ([a-c])x\1x\1 axaxa, bxbxb and cxcxc
x|y (pipe) Matches either x or y bill|ted ted, bill
{n} Matches exactly n instances of preceding character (where n is an integer) ab{2}c abbc
{n,} Matches at least n instances of preceding character (where n is an integer) \s{2,} matches at least 2 whitespace characters.
{n,m} Matches it least n and at most m instances of preceding character (where n and m are integers) \d{2,4} matches at least 2 but no more than 4 digits.
[xyz] Matches any one of enclosed characters (specify range using hyphen, such as [0-9] a[bB]c abc, aBc
[^xyz] Matches any character not enclosed (specify range using hyphen, such as [^0-9] Opposite of above
[\b] Matches a backspace Self Explanatory
\b Matches a word boundary, such as a space. (test characters must exist at the beginning or end of a word within the string) ly\b matches "ly" in "This is really cool."
\B Matches a nonword boundary \Bor matches "or" in "normal" but not "origami."
\d Matches a digit character (same as [0-9]) \d* matches "123" in "abc123"
\D Matches a nondigit character (same as [^0-9]) \D* matches "abc" in "abc123"
\f Matches a form feed Self Explanatory
\n Matches a line feed Self Explanatory
\r Matches a carriage return Self Explanatory
\s Matches a single white space character, including space, tab, form feed, and line feed (same as [\f\n\r\t\v]) Self Explanatory
\S Matches a single non-white-space character (same as [^\f\n\r\t\v]) Self Explanatory
\t Matches a tab Self Explanatory
\v Matches a vertical tab Self Explanatory
\w Matches any alphanumeric character, including the underscore (same as [A-Za-z0-9_]) \w* matches "123" in "123%"
\W Matches any nonword character (same as [^A-Za-z0-9_]) \W* matches "%" in "123%"

MyTechSupport.ca tries to supply accurate and up-to-date information but it is possible that this page may contain typographical errors or technical inaccuracies. Any errors will be periodically corrected as they are made known to us. If any such errors are found, we would appreciate if you would report them here.
Thank You.


Comments
Add New Search
+/- 
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
 
 
 
Disclaimer
This site is NOT responsible for any damage that the information on this site may cause to your system. Everything you try, whether inspired by the response given from this site or not, is entirely at your own risk. All product names and company names used herein are for identification purpose only and may be trademarks or registered trademarks of their respective owners. We are in no way affiliated or representing any of the companies on this site unless specified.
 
Back to Top Back to Top
Generated in 0.14798 Seconds