Re: Regular Expression in Xcode Editor: newlines+whitespace
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