

So I'll add a Line Break at the end there. It can't find the last one because there's no Line Break at the end. We'll do Any Characters and then we will do a Line Break and then we'll get rid of this one here at the beginning because we don't need it anymore if we're going to search the entire line. Let's Undo this and let's say Any Characters for the next set and do a Tab again and then to complete it we'll take the date there. Notice that if you have more than one thing like say we were to do Any Set of Characters. It's got the state abbreviation now after the state name. I hit Replace All and you can see it did exactly that. So then it's going to find a Line Break, a Word, a Tab, Any Set of Characters, and then a Tab and then it's going to put them back but swapping out the Any Set of Characters and the Word. So we can select any of these and we can reverse the order. See below this line is all the things that we're finding. Now we'll go and we want to put the second thing first. So what we'll do is we'll say we'll let's first start with a Line Break again. So let's check Replace here and then let's work on a replacement for this. So we'll insert a line there temporarily and we'll search here again and now we see it found 50 of them. We can go through them and we can see here we've got all of them except the first one because, of course, the first one doesn't start with a line break. So it only happens after the start of a new line. So let's at the beginning say, well let's have this all start with a Line Break. We can see here it's still capturing a bunch of odd things. The reason we don't say word is because you know some states have two words like New Jersey for instance. Then we'll do special pattern again and instead of word we'll say Any Characters. Then we'll do a special pattern for Tab, so Any Word and then the Tab. So the first thing we'll do is we'll find a special pattern for a word. So we can use Find and Replace to fix this. It's perfect except you want it to be the state name first and then the abbreviation. For instance you've got a list here of states and their capitals and the date they became a state.

Now let's say you wanted to search and replace with a tricky replace here. We'll see it found it here and it found it here even though the middle word is different because we're using this kind of wild card for a word there in the middle. So let's change this to something else and Find. Now it's going to find twelve instances where it will find any word that's these three words even if the middle word is something different. Then I'm going to do another space and another word. So it's space and then I'm going to use Insert Pattern and say Any Word, and you can see it inserts a little thing there that says word. I'm going to search for the first word and then I'm going to search for something in the middle. Let's just take these words here, the first and the last one. Let's say, for instance, you want to find two words but they aren't next to each other.

How else would you be able to search for them in TextEdit since you don't know what the phone number or what the email address is.īut there's some other stuff inside of Insert Pattern that allows you to do even more complex searches and even replacements. So it's kind of interesting to be able to use these to quickly find these things. You can see they're even slightly different in their formatting. There's the first one and there's the second one. Clear that out and I'll do that keyboard shortcut, Control, Option, Command P and let's choose Phone Number and it is going to find two phone numbers. We can choose URL and it will find the one URL here. Notice Insert Pattern has Control, Option, Command P as a shortcut. We can also try to find some of those other things. See that little one there and there's the email address in the text. At the bottom there's some very special things like finding an email address. We can see that there's a whole bunch of special stuff in here. Let's select that and we get this second menu here. Now there's also something called Insert Pattern.
BBEDIT GREP REPLACE FULL
Starts With, Full Word, all sorts of stuff. I can Ignore Case, Wrap Around during my search. Then I'm going to use this little magnifying glass here and you can see I have some options. So I'm going to do Command F for Find and clear it out. There's actually a way in TextEdit to find some complex data. You can use these little arrows here to jump to each one and hit Done to exit.īut suppose you wanted to find something more complex. You can choose Edit and then Find, or use Command F, and search for the text.

Video Transcript: Now let's say you wanted to search for some text inside of TextEdit. Check out TextEdit Pattern Search and Replace at YouTube for closed captioning and more options.
