Bring Your Logic using Python
341 subscribers
109 photos
1 video
4 files
544 links
Logic building using Python : Materials, links, e-books and Code snippets
Download Telegram
‎⁦ #python3 ⁩ regex gotcha: not every digit ("\d") looks like digits you know

‎>>> import re
‎>>> re.match(r'\d+', '٢٣٤٥٦٧٨٩')
‎<re.Match object; span=(0, 8), match='٢٣٤٥٦٧٨٩'>

‎Explanation and solution:
🐍Python Tip: To convert your strings to be URL friendly. For example, when constructing an API request/query strings, you can use urllib's quote method like so 👆🏻
#networkautomation #python #python3