I am a new user (purchased yesterday) of TextMate. In the past, I used a great program on Windows called Advanced Find and Replace. It allowed me to search through multiple files within a folder (I see that I can do that by a project in TextMate too). But, what I cannot figure out is if it will allow me to replace things like:
1. Ignoring white space in HTML so that it will find all text to replace even if it is on a separate line and with tabs. Example: <p>This is a paragraph</p>
vs.
<p> This is a paragraph </p>
If it cannot search and find both of these then it is not quite as powerful as I had hoped.
2. Advanced Find and Replace also could find text *between* two strings and either replace it or delete it. For instance, if I wanted to search through this:
I want to replace the word that is between these question marks in multiple documents. ?Delete Me? and ?Delete Me Too?
You would end up with: I want to replace the word that is between these question marks in multiple documents. ?? and ??
Sorry, not a great example :-( but it gets the point across.
This function though could allow you to delete all tables in an HTML document without actually knowing what was in the table....or many other uses. It can delete text before a string or after a string too.
Can TextMate perform these more complicated Search/Replace functions? If not, I still love the app but does anyone know of a comparable app that is similar to Advanced Find and Replace on the Mac since this program is not available for the Mac OSX?
Thank you, Linda
You need to use the regular expression find and replace. Check "Match Regular Expression" in the F&R box. If you don't know how to use regular expressions (they're great!) check out http://www.regular-expressions.info/tutorial.html.
Btw, with regular expressions you can get waaaaaay more advanced find and replace than you're describing. It's really useful.
On 15 Dec 2011, at 00:24, Linda Miller, DVM wrote:
[…] Can TextMate perform these more complicated Search/Replace functions?
Only via regular expressions. Although the current aloha¹ actually has the “Ignore Whitespace” option.
¹ http://blog.macromates.com/2011/textmate-2-0-alpha/
[…] does anyone know of a comparable app that is similar to Advanced Find and Replace on the Mac since this program is not available for the Mac OSX?
The “Ignore Whitespace” I’ve actually only ever heard about once before, the “between text” I have never heard about before, so I doubt the Mac has dedicated apps for this, but you newer know…