• 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
Re: Regular Expression in Xcode Editor: newlines+whitespace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regular Expression in Xcode Editor: newlines+whitespace


  • Subject: Re: Regular Expression in Xcode Editor: newlines+whitespace
  • From: Matthew Morse <email@hidden>
  • Date: Sun, 2 Nov 2008 20:37:02 -0800

I believe you're looking for an expression like this:

^\s+\n

...a line that starts with one or more whitespace characters and then a newline.

-- Matt




On Nov 2, 2008, at 7:42 PM PST, Jerry Krinock wrote:

Whenever I need to do any serious regex search/replace I have to switch to BBEdit because I can never get Xcode's to find expected results. Solving the following simple mystery might be a big help:

Find: \n   This finds a newline.  Great.

Find: \s   This finds a whitespace.  Great.

Find: \s*\n  This finds trailing whitespaces at end of lines.  Great.

But

Find: \n\s
  Expected Result:  Should find any newline followed by a
     whitespace -- roughly, any indented line.
     I have lots of those!
  Actual Result: NSBeep().  Never finds anything.

How can I get my expected result?

Thanks,

Jerry Krinock_______________________________________________
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

_______________________________________________ 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
References: 
 >Regular Expression in Xcode Editor: newlines+whitespace (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Regular Expression in Xcode Editor: newlines+whitespace
  • Next by Date: Re: Regular Expression in Xcode Editor: newlines+whitespace
  • Previous by thread: Regular Expression in Xcode Editor: newlines+whitespace
  • Next by thread: Re: Regular Expression in Xcode Editor: newlines+whitespace
  • Index(es):
    • Date
    • Thread