String literals without escape sequences?
String literals without escape sequences?
- Subject: String literals without escape sequences?
- From: "l.m.orchard" <email@hidden>
- Date: Thu, 2 Aug 2001 10:25:05 -0400
Okay, this sounds like a fairly dumb basic ObjC question to me, but I'm
going to ask it anyway.
I have a regular expression for my PCRE wrapper: \[(\d+)K\] -> \.+ \((\d+)
\%\)
which matches and extracts data from wget progress output (ie.
'[100K] -> ..... (20%)')
However, in all my string literals, the compiler wants to treat all the
characters I escape for the regex as escape sequences for the string, so
my regex gets uglier because I have to double escape everything:
regex = @"\\[(\\d+)K\\] -> \\.+ \\((\\d+)\\%\\)";
Now, regexes are ugly enough as-is... is there a construct I can use to
get around this? From my work in Perl, I'm wishing for the
non-interpolated '' quotes versus the interpolated "" quotes. Is there
anything like this in ObjC?
--
Leslie Michael Orchard <email@hidden>
ICQ: 492905 (home) 11082089 (work)
"...see you space cowboy..."