Skip to content

Instantly share code, notes, and snippets.

@eshafik
Created January 4, 2020 15:59
Show Gist options
  • Select an option

  • Save eshafik/d1afb40a12c4023f4766ca8478ba8250 to your computer and use it in GitHub Desktop.

Select an option

Save eshafik/d1afb40a12c4023f4766ca8478ba8250 to your computer and use it in GitHub Desktop.
import re
text = "I speak Bangla. I live in Bangladesh"
textRegex = re.compile(r"Bangla(desh)+") # 1 or more time
print(textRegex.search(text))
# Output:
<re.Match object; span=(26, 36), match='Bangladesh'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment