user2924482 user2924482 - 1 year ago 188
Swift Question

Swift:Regular expression to detect IP address in string

I'trying to detect if IP address is inside of string for example:

"home is connected"

Any of you knows if is regular expression I can use to detect the ip and modify the ip?

I'll really appreciate your help

Answer Source

You can try this regex:



Then, check out this question to learn how to use this Regex in Swift to modify the current ip to a different one:

Swift replace substring regex

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download