This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

reading regexp from txt files

Old posts that have not been replied to for several years.
Locked
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

reading regexp from txt files

Post by droolin »

Is there anything special that would needed to be done to read regular expresions from a .txt file into an array?
I have a security bot that basicatly I keep adding regular expresions for specific checks(nicks/idents/version), and I would like to organize it so that it just loops an array of regular expresions for specific checks instead of adding a bunch of if statements that basicatly do the same thing except with a different regular expresion.
Basicatly, the text file would look something like this hopefully:

Code: Select all

{[A-Z][a-z]+_[0-9][0-9]} Your chat client meets the criteria of a known spam bot.  Please change your nick if this is not the case.
Frist part would be the regular expression with the second part being the gline/ban reason. Ok, two arrays but still. Would there be anything special as far as reading that from a file into an array?

droolin
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: reading regexp from txt files

Post by user »

droolin wrote:Is there anything special that would needed to be done to read regular expresions from a .txt file into an array?
No.
Have you ever read "The Manual"?
Locked