Sideway
output.to from Sideway
Draft for Information Only

Content

.Net and ASP Regular Expression
 .NET and ASP Regular Expression Comparison

.Net and ASP Regular Expression

Source/Reference: https://msdn.microsoft.com/en-us/library/2k3te2cs(v=vs.110).aspx

In Visual Studio 2010 and earlier versions, Visual Studio used custom regular expression syntax in the Find and Replace windows. In Visual Studio 2012 and later, Visual Studio uses .NET Framework regular expressions to find and replace text.

.NET and ASP Regular Expression Comparison

The comparison of some commonly used custom ASP and .Net Framework regular expression symbols.

Purpose.NetASP.Net Example Match any single character (except a line break)..a.o matches "aro" in "around" and "abo" in "about" but not "acro" in "across". Match zero or more occurrences of the preceding expression (match as many characters as possible)**a*r matches "r" in "rack", "ar" in "ark", and "aar" in "aardvark" Match any character zero or more times (Wildcard *).*.*c.*e matches “cke” in “racket”, “comme” in “comment”, and “code” in “code” Match one or more occurrences of the preceding expression (match as many characters as possible)++e.+e matches "eede" in "feeder" but not "ee". Match any character one or more times (Wildcard ?).+.+e.+e matches "eede" in "feeder" but not "ee". Match zero or more occurrences of the preceding expression (match as few characters as possible)*? @e.*?e matches "ee" in "feeder" but not "eede". Match one or more occurrences of the preceding expression (match as few characters as possible)+?#e.+?e matches "ente" and "erprise" in "enterprise", but not the whole word "enterprise". Anchor the match string to the beginning of a line or string^^^car matches the word "car" only when it appears at the beginning of a line. Anchor the match string to the end of a line\r?$$End\r?$ matches "end" only when it appears at the end of a line. Match any single character in a set[abc][abc]b[abc] matches "ba", "bb", and "bc". Match any character in a range of characters[a-f][x-y]be[n-t] matches "bet" in "between", "ben" in "beneath", and "bes" in "beside", but not "below". Capture and implicitly number the expression contained within parenthesis()()([a-z])X\1 matches "aXa"and "bXb", but not "aXb". ". “\1” refers to the first expression group “[a-z]”. Invalidate a match(?!abc)~(abc)real (?!ity) matches "real" in "realty" and "really" but not in "reality." It also finds the second "real" (but not the first "real") in "realityreal". Match any character that is not in a given set of characters[^abc][^abc]be[^n-t] matches "bef" in "before", "beh" in "behind", and "bel" in "below", but not "beneath". Match either the expression before or the one after the symbol.||(sponge|mud) bath matches "sponge bath" and "mud bath." Escape the character following the backslash\\\^ matches the character ^. Specify the number of occurrences of the preceding character or group{x}, where x is the number of occurrences\x, where x is the number of occurrencesx(ab){2}x matches "xababx", and x(ab){2,3}x matches "xababx" and "xabababx" but not "xababababx". Match text in a Unicode character class, where “X” is the Unicode number. For more information about Unicode character classes, see Unicode Standard 5.2 Character Properties.\p{X}:X\p{Lu} matches "T" and "D" in "Thomas Doe". Match a word boundary\b (Outside a character class \b specifies a word boundary, and inside a character class specifies a backspace).< and > specify the beginning and end of a word\bin matches "in" in "inside" but not "pinto". Match a line break (ie a carriage return followed by a new line).\r?\n\nEnd\r?\nBegin matches "End" and "Begin" only when "End" is the last string in a line and "Begin" is the first string in the next line. Match any alphanumeric character\w:aa\wd matches "add" and "a1d" but not "a d". Match any whitespace character.(?([^\r\n])\s):bPublic\sInterface matches the phrase "Public Interface". Match any numeric character\d:d\d matches and "3" in "3456", "2" in 23", and "1" in "1". Match a Unicode character\uXXXX where XXXX specifies the Unicode character value.\uXXXX where XXXX specifies the Unicode character value\u0065 matches the character "e". Match an identifier\b(_\w+|[\w-[0-9_]]\w*)\b:iMatches "type1" but not &type1" or "#define". Match a string inside quotes((\".+?\")|('.+?')):qMatches any string inside single or double quotes. Match a hexadecimal number\b0[xX]([0-9a-fA-F])\b:hMatches "0xc67f" but not "0xc67fc67f". Match integers and decimals\b[0-9]*\.*[0-9]+\b:nMatches "1.333".

©sideway

ID: 180700014 Last Updated: 7/14/2018 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019