Regex separating port from IP
Hello! I am trying to find a way to separate the port from IP using regex, but i have no clue how to achieve this. Wish there was a similar function as PHP's explode() :-)
new serverip[25] new serverport[6] get_user_ip(99, serverip, 25, 0) ... |
Re: Regex separating port from IP
Using get_user_ip(), to get the ip without port, replace 0 by 1.
You can retrieve the "ip" as a server cvar the same for "port". You don't need regex. Edit : Or like said Yami, you can break using for example strtok(). |
Re: Regex separating port from IP
separate PORT from ip. I am trying to get the server's port and store it in a string.
|
Re: Regex separating port from IP
Break the string at ':' and you will have the IP and Port.
|
Re: Regex separating port from IP
So there is a function similar to PHP's explode()
Could you please point it out for me? |
Re: Regex separating port from IP
Have you even looked for yourself yet?
http://amxmodx.org/funcwiki.php?go=func&id=872 http://amxmodx.org/funcwiki.php?go=func&id=860 |
Re: Regex separating port from IP
Thank you
|
Re: Regex separating port from IP
untested
PHP Code:
|
Re: Regex separating port from IP
More easier to use strtok() :
PHP Code:
|
Re: Regex separating port from IP
IP addresses are only 15 characters Arkshine.
PHP Code:
|
| All times are GMT -4. The time now is 07:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.