Reputation: 21
How do I only use python
from <:python:456490778085163011>
Upvotes: 1
Views: 43
Reputation: 2694
Try this without using re
.
'<:python:456490778085163011>'.split(':')[1]
Using re
def printWord(txt):
resp = re.match('^<:(?P<word>\w*):\d+>\w*$', txt)
if resp:
print(resp.group('word'))
printWord('<:python:456490778085163011>')
printWord('<:java:4564907324085163011>')
printWord('<:anyword:456490778085163011>')
Hope it will help!
Upvotes: 1