• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
String literals without escape sequences?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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..."


  • Prev by Date: NSAWTView: please vote
  • Next by Date: Major Bug in Cocoa (With sample Code!!)
  • Previous by thread: Re: NSAWTView: please vote
  • Next by thread: Major Bug in Cocoa (With sample Code!!)
  • Index(es):
    • Date
    • Thread