'Regex match string containing digits and ends with x
I had just recently started using regex in python, so sorry if it's too trivial. I'm trying to extract string that consists of digits and ends with letter x. For example from input asdx12x4 I want to get 12x.
I tried
import re
text = "asdx12x4"
result = re.findall("\d+x$", text)
print (result)
However result is such:
[]
Any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
