fix username escape in whois regex
This commit is contained in:
parent
ad96b14445
commit
bd5621f9bd
3
bert.py
3
bert.py
|
@ -204,10 +204,9 @@ def is_registered(username):
|
||||||
try:
|
try:
|
||||||
sendRaw("WHOIS "+str(username)+"\n")
|
sendRaw("WHOIS "+str(username)+"\n")
|
||||||
user_info = getMessage()
|
user_info = getMessage()
|
||||||
regex = r"330 "+str(nick)+" "+str(username)+" [a-zA-Z0-9]+ :is logged in as"
|
regex = r"330 "+str(re.escape(nick))+" "+str(re.escape(username))+" \S+ :is logged in as"
|
||||||
matches = re.finditer(regex, user_info, re.MULTILINE)
|
matches = re.finditer(regex, user_info, re.MULTILINE)
|
||||||
for match in matches:
|
for match in matches:
|
||||||
print(match.group(0))
|
|
||||||
acc_name = match.group(0).split()[3]
|
acc_name = match.group(0).split()[3]
|
||||||
return acc_name
|
return acc_name
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user