2. Slide 20 is misleading because it suggests that the given regular expression will match only lines that contain a "(" followed by a ")" (with 0 or more arbitrary characters in-between). The fact is that that regular expression will match *any* line whatsoever, whether it includes parentheses or not. The regular expression that represents your examples would be \(.*\) or, better yet, \([^)]*\)
@gb590212h
11 жыл бұрын
There are several significant errors in this lecture. 1. In slide 13, the explanation given for why the regular expression matches the last line is incorrect. The "." matches exactly one character. It will never match an empty string. In the case of the last line in that slide, the regular expression matches the substring "9911" of the line, and therefore, the "." is matching the second 9 of this substring.
@lalaithan
6 жыл бұрын
He definitely teaches this better than Jeff Leek (professor in the same dept), in my humble opinion.
@wessauder7708
8 жыл бұрын
Great walkthrough - I've been forcing my way through this subject for awhile, but I'm glad I finally took the time to properly walk through slowly with good explanations. As usual, your presentations are always gentle to absorb and not overwhelming! Thanks for the link to this in your rPub book 'R Programming for Data Science' which is equally well done.
@gb590212h
11 жыл бұрын
3. In slide 22, the regexp given will not match any of the example lines shown, but [Bb]ush( +[^ ]+){1,5} debate will. (The difference is that the repeated pattern in this one does not end with " +".)
@jxy4239
6 жыл бұрын
thanks - answered my question
@aaljaish100
4 жыл бұрын
Thank you, I literally was working on this issue for several hours thinking I was doing something wrong...apparently I was not...
@gb590212h
11 жыл бұрын
4. The parenthesized subexpressions (of the given example lines) matched by the regular expressions given in slides 26 and 27 will be identical (contrary to what Prof. Peng implies). This is because the regular expression in slide 27, namely, ^s(.*?)s$ has an end-of-line anchor ($) at the end, and all the example lines happen to end with the character "s". Therefore, as far as these examples is concerned, the "?" modifier (which is the subject of slide 27) will actually have no effect.
@gabrielesciortino2268
2 жыл бұрын
just write it as ^s(.*?)s right?
@otraperspectiva
6 жыл бұрын
Thank you very much for this!
@sekaranvv
3 жыл бұрын
lwwetuo
@TiffanyNg100
2 жыл бұрын
really clear to understand thanks
@georgigeorgiev2219
9 жыл бұрын
Thank you. GOD bless you.
@1234tombaker
Жыл бұрын
Why, between slides 20 and 21, does the (.*) suddenly NOT refer to open or closed parentheses? I.e. the thing being searched for (with anything or nothing in the middle). There are no parentheses in slide 21 but it only means anything between a numeric.
@stewarttoop4031
Жыл бұрын
@gb590212h 10 years ago 2. Slide 20 is misleading because it suggests that the given regular expression will match only lines that contain a "(" followed by a ")" (with 0 or more arbitrary characters in-between). The fact is that that regular expression will match *any* line whatsoever, whether it includes parentheses or not. The regular expression that represents your examples would be \(.*\) or, better yet, \([^)]*\)
Пікірлер: 19