i am new to coding and was trying to write a function that counts the number potato patterns in a string, so i found this code that uses regex, given that i know nothing about regex. Code is working fine.
so this is what i understood
–we created a function count that takes str as a parameter.
–then we saved the patterns inside re. now what the hell is this third line that starts with return, can anyone please put it into words so that i know what it means??? i know what return is but what’s after that ???
FCC has a section on regex that you can go through.
There is also an handy tool online called regex 101. You can put your regular expressions in there and it gives detailed explanations on what the code is doing. It kind of acts like a debugger for regex.