I love this class, but I am having trouble figuring out how to use hostmasks stored in a file, and compare them to the realhost from the users. For example.
You can do this with regular expressions.
You should replace the IRC wildcards with the regular ones.
* should became something like [a-z0-9\._-]*, but containing all characters available for IRC
For example:
*!*@*.anything.com should be something like
[a-z0-9_-\[\]]*![a-z0-9_-\[\]]*@[a-z0-9_-]*.anything.com
I'm not good at regular expressions, so please read the php help file for this topic.
Have fun
Horcsog
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not the best with regualar expressions either, but I will play around with it.
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-07-06
just as a pointer, *@*.buf.adelphia.net isn't a valid irc host, but *!*@*.buf.adelphia.net would be (nick!ident@host)
anyhow. The format i use for hostmasks would look like this: "^[^!]*![^@]@[^.]\.buf\.adelphia\.net$". The starting ^ and tailing $ aren't necessary, but i use them. And don't forget to escape dots, if you want the literal dot to be matched (not any charachter)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-07-06
typical, i forgot two asterisks. sorry 'bout that:
^[^!]*![^@]*@[^.]*\.buf\.adelphia\.net$
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks hpaul that helps alot. I have one more question. How could I take the full hostname and make a hostmask from that? I am guessing preg_replace, but I have yet to figure out regular expressions and can't get anything to work right. If you could help me with this it would be great, otherwise I am sure I will figure it out sooner or later.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-07-08
I haven't tried replacing expressions, i'm sorry. But solving that problem in some conventient way would be handy.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I love this class, but I am having trouble figuring out how to use hostmasks stored in a file, and compare them to the realhost from the users. For example.
Hostmask: *@*.buf.adelphia.net
Realhost: xavia@ny-hamburg2b-36.buf.adelphia.net
I want to be able to tell that the realhost matches the hostmask. How could I do this in php? Any help would be great.
You can do this with regular expressions.
You should replace the IRC wildcards with the regular ones.
* should became something like [a-z0-9\._-]*, but containing all characters available for IRC
For example:
*!*@*.anything.com should be something like
[a-z0-9_-\[\]]*![a-z0-9_-\[\]]*@[a-z0-9_-]*.anything.com
I'm not good at regular expressions, so please read the php help file for this topic.
Have fun
Horcsog
Thanks,
I am not the best with regualar expressions either, but I will play around with it.
Matt
just as a pointer, *@*.buf.adelphia.net isn't a valid irc host, but *!*@*.buf.adelphia.net would be (nick!ident@host)
anyhow. The format i use for hostmasks would look like this: "^[^!]*![^@]@[^.]\.buf\.adelphia\.net$". The starting ^ and tailing $ aren't necessary, but i use them. And don't forget to escape dots, if you want the literal dot to be matched (not any charachter)
typical, i forgot two asterisks. sorry 'bout that:
^[^!]*![^@]*@[^.]*\.buf\.adelphia\.net$
Thanks hpaul that helps alot. I have one more question. How could I take the full hostname and make a hostmask from that? I am guessing preg_replace, but I have yet to figure out regular expressions and can't get anything to work right. If you could help me with this it would be great, otherwise I am sure I will figure it out sooner or later.
I haven't tried replacing expressions, i'm sorry. But solving that problem in some conventient way would be handy.
If I find anything out myself I will make sure to post it here.