I have a string
1563:37say: 0 kl4|us: !!alias kl4
and I need to extract some information. I'm trying with this Python code:
import re
x = "1563:37say: 0 kl4us: !!alias kl4"
res = re.search( r"(?P<say>say(team)?): (?P<id>\d+) (?P<name>\w+): (?P<text>.*)",x)
slot= res.group("id")
text = res.group("text")
say = res.group("say")
name = res.group("name")
This code works fine. Why if I have a character | or * into my string this regexp doesn't work?
For example:
import re
x = "1563:37say: 0 kl4|us: !!alias kl4"
res = re.search( r"(?P<say>say(team)?): (?P<id>\d+) (?P<name>\w+): (?P<text>.*)",x)
slot= res.group("id")
text = res.group("text")
say = res.group("say")
name = res.group("name")
Anyone can help me?
Thanks a lot