• 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
Regexp search and replace spanning multiple lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regexp search and replace spanning multiple lines


  • Subject: Regexp search and replace spanning multiple lines
  • From: Jean-Denis Muys <email@hidden>
  • Date: Tue, 9 Oct 2007 01:32:28 +0200

Hi,

I have some issues regarding search and replace using regular expressions with XCode.

I can't manage to write a regular expression matching text on two (or more) consecutive lines. The problem is with the end of line character.

Let's suppose an XCode Window contains the following lines:

AA x
BB y
BB z

I want to transform it into:

AA x
BB y
AA x
BB z

I can match the first line using the following reg exp:

^connect .*\r

But the slightly changed regexp to expand the match to the following line doesn't work:

^connect .*\rBB

Why? Can I work the problem around?

Incidentally, the XCode documentation points to the ICU page at

http://icu-project.org/userguide/regexp.html

But there are some obvious differences. For example the ICU page states that $n represents capture group n. That doesn't work in XCode, which requires \n.

TIA,

Jean-Denis, back to XCode after a long time away.

[Note: If I were using XCode 3, is there any mailing lists open only to people under NDA, so that I could discuss it more specifically?]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Regexp search and replace spanning multiple lines
      • From: Laurence Harris <email@hidden>
  • Prev by Date: Re: Am I Being Debugged?
  • Next by Date: Re: Regexp search and replace spanning multiple lines
  • Previous by thread: Re[2]: Am I Being Debugged?
  • Next by thread: Re: Regexp search and replace spanning multiple lines
  • Index(es):
    • Date
    • Thread