Regular Expressions (RegEx) are a powerful tool used to match or search for a pattern in a string. To use them in Python you need to import the re module. You can do this by adding the following line at the top of your file:
import re
Write a regular expression that will match any file located within the "users/innokodakademija" directory. You must use at least one RegEx line anchor.
pattern = "yourregularexpressionhere"
bool(re.search(pattern, "/users/innokodakademija/python/regex.py")) ➞ True
bool(re.search(pattern, "/users/innokodakademijat/python/file.txt")) ➞ False
bool(re.search(pattern, "/users/pyter/innokodakademija/file.py")) ➞ False
import re from the code.