Click here to Skip to main content
11,928,987 members (52,987 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
Hi All,
This is related to a question asked yesterday about the use of RegEx to give it full title:
RegEx madness, or how to make it variable?
by using ProEggNog's answers I have managed to get the application to use

//     string regExp = @"(?<=<).+?(?=>)";     //working RegEx for < > around data
     //     string regExp = @"(?<=\[).+?(?=\])";//working RegEx for [ ] around data
     //     string regExp = @"(?<=!).+?(?=!)";//working RegEx for ! ! around data
          string regExp = @"(?<=\").+?(?=\")";//?????????
however I'm trying use " around the data my first though was to place \ in front of the " as the intelli-sense showed it was seeing the " as the closing " for the statement, the Expresso app for the 30 Minute RegEx tutorial seems to agree with me though? anyone any ideas apart from don't use " ???
Posted 26-Mar-12 23:40pm
Edited 26-Mar-12 23:42pm
Manfred R. Bihy 27-Mar-12 4:45am
"ProEggNog", eh? I think ProEngSoft would be a better fit, but hey do as you please.
OriginalGriff 27-Mar-12 4:48am
Maybe he is the one person in the world who actually enjoys egg nog? :laugh:
glennPattonWork 27-Mar-12 5:02am
To all who have seen this I am sorry ProEngSoft, thinking about not relavent!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Right, yes...
string regExp = @"(?<=\"").+?(?=\"")";
When you prefix a string with '@' it turns normal blackslash processing
off, so \" doesn't work any more. You need to use "" instead to insert a single double quote, and backslash on it's own to insert a backslash.
glennPattonWork 27-Mar-12 5:51am
Dang! thought I tried it and it didn't work, tried it again (with the " in the right places probably)
OriginalGriff 27-Mar-12 6:01am
:laugh: I have days like that all the time!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 27 Mar 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100