Line breaks and Multiline mode


show more Line breaks and Multiline mode provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions show less
please wait ...

Line breaks and Multiline mode

In the last movie, we learned about the anchor metacharacters. And at the time, you may have noticed a small difference between the caret, and the backslash A, and between the dollar sign, and the backslash Z. They aren't exactly the same in their meaning because of how they handle new lines differently. In this movie, we'll learn why, and also learn how to apply these anchors to multi-line strings. First let's see the problem in action. So here in RegexPal, I just have a very simple shopping list that we've seen before, and I came up with the very simple, regular expression. Lowercase letters a to z, and a space inside a character set, repeated one or more times.

Now let's put an anchor at the beginning of this. Let's put the caret, and you can see that it matches, now, only milk. That's it. It didn't match each of those lines; it matched just the beginning of the entire string. Let's try it again, and at the end, let's put a dollar sign. Now it did...

Line breaks and Multiline mode
Video duration: 4m 41s 5h 36m Intermediate

Viewers:

Line breaks and Multiline mode provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions

Subject:
Developer
Software:
Regular Expressions
Author:
please wait ...