So opening a file each time user tries to sign up, going through each line of the file that gets bigger every day and doing regex match against each line? OK, I see you didn't write anything at scale.
You know you can just keep the file open, right? You don't have to open and close it for every user.
You're not matching regex against every line. Read the last code block carefully. You're creating one regex that matches every line in the file simultaneously.
6
u/IAmTheSysGen Oct 07 '21 edited Oct 07 '21
Man, it's pretty easy to read from a file each line in a for loop.
You can also easily refactor this code. Copy the lines to a banlist.txt file.
Do a search and replace "OR ue.login LIKE " with ""
Do a simple
Or if you want to be as efficient as the OP
It should take at most 15 minutes to refactor the code above into the proper way (tm).