From the course: Learning Regular Expressions

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Anchors

Solution: Anchors

(upbeat music playing) - In this movie, I'll walk you through my solution to the Anchors Challenge assignment. Our first challenge, was to see how many paragraphs start with the capital letter 'I' all by itself, as a single word. As in 'I read.' You see it right here, at the very beginning, 'I (space) read.' We want to find that 'I.' So, we could just put in a capital letter 'I' and that would certainly find it, but if there's any other time where we have a capital letter 'I,' it's also going to find it. Where we want to find it is when it's at the beginning of the paragraph, and we can use our anchors to do that. So, I'm going to put the opening anchor at the beginning. Now, it's not finding it. Do you remember why? It's because we're just using Global Mode. We're not using the Multilane Mode. So, I also need to switch it to Multilane Mode. And then, it says there are nine matches that it's finding. Now, if I had the word…

Contents