re not working

CrazyVideoGamez jasonanyilian at gmail.com
Mon Sep 16 21:31:48 EDT 2019


For some reason these are different:

pattern = r'[0-9]{4,6}'

And

pattern2 = r'[0-9][0-9][0-9][0-9]([0-9]){0,2}'

And when I try to match them

import re
re.search(pattern, '1234')

and

import re
re.search(pattern2, '1234')

are different. Help?



More information about the Python-list mailing list