Click here to Skip to main content
11,706,639 members (32,266 online)
Rate this: bad
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 22:40pm
Edited 26-Mar-12 22:42pm
Manfred R. Bihy at 27-Mar-12 4:45am
"ProEggNog", eh? I think ProEngSoft would be a better fit, but hey do as you please.
OriginalGriff at 27-Mar-12 4:48am
Maybe he is the one person in the world who actually enjoys egg nog? :laugh:
glennPattonWork at 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 at 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 at 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
0 OriginalGriff 146
1 Sergey Alexandrovich Kryukov 115
2 chainerlt 110
3 Mika Wendelius 80
4 ppolymorphe 71
0 OriginalGriff 9,190
1 Sergey Alexandrovich Kryukov 8,407
2 CPallini 5,189
3 Maciej Los 4,756
4 Mika Wendelius 3,686

Advertise | Privacy | Mobile
Web04 | 2.8.150819.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