Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 100x100 - OK
- 100%x100 - OK
- 99x99 - OK
- 99%x100 - not OK
- 99x99% - not OK
- s = '100%x99%' # this should be failed
- match = re.match(r'(100%|d+(?!%))x(100%|d+(?!%))', s)
- if match:
- x = match.group(1)
- y = match.group(2)
- re.match(r'(100%|d+(?!%))x(100%|d+(?!%))$', s)
- (100%|d+)x(100%|(d+(?!%|d)))
Add Comment
Please, Sign In to add comment