RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
"((\\")|[^"(\\")])+"
Description
Matches quoted string, using \" as an escape to place quotes in the string
Matches
"test" | "escape\"quote" | "\""
Non-Matches
test | "test | "test\"
Author Rating: The rating for this expression. Alessandro Vergani
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Is this character class correct?
Name: Elmar
Date: 6/23/2008 7:11:15 AM
Comment:
Is it possible that the [^"(\\")] bit wants to say, "neither a quote nor an escaped quote"? I don't think you can use grouping constructs like (\\") inside a character class. As it is, it adds the parentheses and the backslash to the character class, which is probably the reason why the regex won't match strings with enclosed parentheses or backslashes, like "(parentheses)", "back\slash".


Title: Not work with some strings.
Name: the DtTvB
Date: 2/10/2007 12:51:28 AM
Comment:
This pattern won't match these: - "Hello.\nLOL!" - "Hello\\"


Title: doas match (\")
Name: redas
Date: 12/24/2006 4:35:42 AM
Comment:
I have fixed it a bit like that "((\\")|[^"\\"])*" becouse of * it does match and empty string ""


Title: Does not match strings with brackets
Name: Alex
Date: 10/21/2004 1:57:04 PM
Comment:
I won't match "test(\")test"


Title: New Regular Expression wanted
Name: Mehdi
Date: 5/13/2003 1:32:03 AM
Comment:
Hi, It's an excellent website. Thanks for the several Regular expressions. I found a problem in one Expression with description 'Matches quoted string, using \" as an escape to place quotes in the string'. I've tested following matches ["test"], ["escape\"quote"] but didn't response. regards, Mehdi mahdiko@creative.com.au


Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials