Solve 03
This commit is contained in:
parent
7af6522140
commit
4076dbc44e
23
03/find_pattern.py
Normal file
23
03/find_pattern.py
Normal file
@ -0,0 +1,23 @@
|
||||
from utils.Url import Url
|
||||
from utils.read import read_string
|
||||
import re
|
||||
|
||||
|
||||
def find_pattern(pattern_string):
|
||||
string = read_string('string.txt')
|
||||
regex = re.compile(pattern_string)
|
||||
matches = regex.findall(string)
|
||||
return ''.join(matches)
|
||||
|
||||
|
||||
def main():
|
||||
pattern_string = r'[a-z][A-Z]{3}(?P<solution>[a-z]){1}[A-Z]{3}[a-z]'
|
||||
string = find_pattern(pattern_string)
|
||||
builder = Url()
|
||||
builder.slug = 'php'
|
||||
builder.solution = string
|
||||
print(builder.url)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
1250
03/string.txt
Normal file
1250
03/string.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user