Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

How to generate a Regex for multiple IP Address ??


Dear All,

I want to generate a Regex expression for multiple IP addresses, but there's a twist i want expression like suppose I have URL: --< URL has been accessed by different client IP.

So i need client IP - (* or*) that Hits the Url ( out of (*,*)

Its like Logical Or operation i need to do ??



Hi Laxmi,

Probably the simplest way to handle 'OR' as you are asking is to use a character set.

The RegEx 24[57] will match an input of 245 or 247. The [57] is a character set and will match on an input that has a 5 or a 7 at the specified position. So 24[517] would match 245, 241, or 247.

Here is a RegEx you could use to match any IP with 245 or 247 as the third octet:


This technically matches on invalid IPs as well such as 999.999.245.999 so if you don't like that you can use a more specific and complicated RegEx like:


But really you should be fine with the simpler RegEx if you're not expecting or concerned about invalid IPs. Let me know if that RegEx works for your scenario.



Hi Steve,

Thank you, with your provided explanation i am good to resolve the transformation regex as per my requirement.

with regards,

Laxmi Prakash