Created
March 4, 2020 10:40
-
-
Save jumasheff/6c3e377a6024b24b147f70dbc53b389a to your computer and use it in GitHub Desktop.
Finds particular string at returns it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| l = ['123 м2', '123.43 м2 ывсвсв', None, ''] | |
| def t(x): | |
| if x is None: | |
| return '' | |
| m = re.findall('^[-+]?[0-9]*[.,]?[0-9]+\s*м2', x) | |
| if len(m) > 0: | |
| return m[0] | |
| return '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment