Maybe I’m misunderstanding, but it seems like some of these aren’t clear on what they do or why you’d use them. I don’t understand what the pipe does because it seems like it wasn’t really demonstrated. Is it like an “else” i.e. search the string for “forged” and if you can’t find it then search for “clean”? What’s the point of match() if you can use a ^ to search the beginning of a string? What’s the point of doing re.compile() and then pattern.search() if you can combine those into a single re.search() function call?
in this video, i have tried to explain about, how different methods of re library work on string. I have also used few metacharacters, anchors and quantifiers.
Please consider this video as beginners level explanation.
Yes, it would be a better video, if i have explained about, why we require these methods. how one method of re are different from others.
but to avoid any confusion and to make this video as beginners friendly i have choose not to include these explanation.
1
u/jampk24 Jun 21 '21
Maybe I’m misunderstanding, but it seems like some of these aren’t clear on what they do or why you’d use them. I don’t understand what the pipe does because it seems like it wasn’t really demonstrated. Is it like an “else” i.e. search the string for “forged” and if you can’t find it then search for “clean”? What’s the point of match() if you can use a ^ to search the beginning of a string? What’s the point of doing re.compile() and then pattern.search() if you can combine those into a single re.search() function call?