How to find string in range?
-
based on my current search with 10.116.106. I am able to find following results but I want to narrow it to following range only - 10.116.106.208 - 10.116.106.223. Is there advanced search way I can find the exact what I am looking for?
Line 3089: “10.116.106.172”
Line 3232: “10.116.106.64/27”
Line 3250: “10.116.106.32/28”
Line 3901: “10.116.106.176/28”
Line 3922: “10.116.106.176/28”
Line 3948: “10.116.106.176/28”
Line 3977: “10.116.106.176/28”
Line 5335: “10.116.106.75”
Line 5357: “10.116.106.75”
Line 5467: “10.116.106.172”
Line 5627: “10.116.106.172”
Line 5812: “10.116.106.164”
Line 5977: “10.116.106.164”,
Line 5982: “10.116.106.160/29”
Line 6000: “10.116.106.128/26”
Line 6019: “10.116.106.168/29”
Line 6034: “10.116.106.128/26”
Line 6037: “10.116.106.168/29”
Line 6055: “10.116.106.168/29”
Line 6073: “10.116.106.168/29”
Line 6091: “10.116.106.168/29”
Line 6109: “10.116.106.168/29”
Line 6169: “10.116.106.164”
Line 6187: “10.116.106.168/29”,
Line 6188: “10.116.106.160/29”
Line 6206: “10.116.106.164”
Line 6431: “10.116.106.172”,
Line 6898: “10.116.106.71”,
Line 6899: “10.116.106.72”,
Line 6900: “10.116.106.39”,
Line 6901: “10.116.106.40”,
Line 6902: “10.116.106.64/27”
Line 7062: “10.116.106.172”
Line 10468: “10.116.106.172”
Line 10896: “10.116.106.64/27”
Line 10914: “10.116.106.64/27”
Line 10932: “10.116.106.64/27”,
Line 10951: “10.116.106.64/27”,
Line 10952: “10.116.106.48/28”
Line 10973: “10.116.106.64/27”
Line 12244: “10.116.106.208/28”
Line 12262: “10.116.106.214”,
Line 12263: “10.116.106.215”,
Line 12264: “10.116.106.217”,
Line 12265: “10.116.106.216”,
Line 12266: “10.116.106.212”,
Line 12267: “10.116.106.213”
Line 12288: “10.116.106.216”,
Line 12289: “10.116.106.217”,
Line 12290: “10.116.106.212”,
Line 12291: “10.116.106.213”,
Line 12292: “10.116.106.214”,
Line 12293: “10.116.106.215”
Line 12983: “10.116.106.208/28”
Line 13125: “10.116.106.224/28”
Line 13233: “10.116.106.208/28”
Line 13253: “10.116.106.224/28”
Line 13268: “10.116.106.224/28”
Line 13286: “10.116.106.208/28”
Line 13304: “10.116.106.208/28”
Line 13322: “10.116.106.224/28”
Line 13342: “10.116.106.208/28”
Line 13362: “10.116.106.208/28”
Line 13874: “10.116.106.164”,
Line 13894: “10.116.106.164”,
Line 15373: “10.116.106.172”
Line 15524: “10.116.106.160/29”
Line 17661: “10.116.106.0/25”
Line 20144: “10.116.106.164”,
Line 22301: “10.116.106.164”
Line 22320: “10.116.106.164”
Line 22558: “10.116.106.64/27”
Line 22677: “10.116.106.172”
Line 23896: “10.116.106.168/29”
Line 23914: “10.116.106.168/29”
Line 23917: “10.116.106.128/26”
Line 23932: “10.116.106.168/29”
Line 23951: “10.116.106.172”
Line 23970: “10.116.106.172”
Line 23990: “10.116.106.172”
Line 24008: “10.116.106.172”
Line 24027: “10.116.106.172”
Line 24050: “10.116.106.164”
Line 24068: “10.116.106.172”
Line 24086: “10.116.106.168/29”,
Line 24087: “10.116.106.160/29”
Line 24105: “10.116.106.160/29”
Line 24224: “10.116.106.172”
Line 24310: “10.116.106.172”
Line 24329: “10.116.106.172”,
Line 24330: “10.116.106.173”,
Line 24351: “10.116.106.164”
Line 24369: “10.116.106.160/29”
Line 24389: “10.116.106.172”,
Line 24434: “10.116.106.160/29”,
Line 24435: “10.116.106.168/29”,
Line 26733: “10.116.106.164”,
Line 30610: “10.116.106.164”
Line 30677: “10.116.106.55”
Line 31102: “10.116.106.164”
Line 32753: “10.116.106.165”
Line 32912: “10.116.106.164”
Line 34049: “10.116.106.164”
Line 38580: “10.116.106.172”
Line 39538: “10.116.106.176/28”
Line 41216: “10.116.106.55” -
@Hardik-Shah said in How to find string in range?:
based on my current search with 10.116.106. I am able to find following results but I want to narrow it to following range only - 10.116.106.208 - 10.116.106.223. Is there advanced search way I can find the exact what I am looking for?
10\.116\.106\.2(0[8-9]|1\d|2[0-3])
Be sure Search Mode: Regular expression is selected. -
@Coises Thank you so much it worked like charm!!!
-
@Coises said in How to find string in range?:
10.116.106.2(0[8-9]|1\d|2[0-3])
If the range is like this how can I narrow it range from - 10.116.10.0 - 10.116.10.31 ?
Line 1073: “10.116.10.0/26”
Line 1094: “10.116.10.36/32”
Line 1415: “10.116.100.69/32”
Line 1445: “10.116.10.0/26”
Line 1529: “10.116.10.36”
Line 1622: “10.116.10.0/26”
Line 2133: “10.116.10.36”
Line 2148: “10.116.10.0/26”
Line 2208: “10.116.10.0/27”
Line 3089: “10.116.106.172”
Line 3232: “10.116.106.64/27”
Line 3250: “10.116.106.32/28”
Line 3553: “10.116.10.36”
Line 3568: “10.116.10.0/26”
Line 3901: “10.116.106.176/28”
Line 3922: “10.116.106.176/28”
Line 3948: “10.116.106.176/28”
Line 3977: “10.116.106.176/28”
Line 4445: “10.116.104.224/28”
Line 4466: “10.116.104.224/28”
Line 4492: “10.116.104.224/28”
Line 5030: “10.116.102.224/28”
Line 5335: “10.116.106.75”
Line 5357: “10.116.106.75”
Line 5467: “10.116.106.172”
Line 5627: “10.116.106.172”
Line 5812: “10.116.106.164”
Line 5977: “10.116.106.164”,
Line 5982: “10.116.106.160/29”
Line 6000: “10.116.106.128/26”
Line 6019: “10.116.106.168/29”
Line 6034: “10.116.106.128/26”
Line 6037: “10.116.106.168/29”
Line 6055: “10.116.106.168/29”
Line 6073: “10.116.106.168/29”
Line 6091: “10.116.106.168/29”
Line 6109: “10.116.106.168/29”
Line 6169: “10.116.106.164”
Line 6187: “10.116.106.168/29”,
Line 6188: “10.116.106.160/29”
Line 6206: “10.116.106.164”
Line 6256: “10.116.107.110”
Line 6292: “10.116.107.110”
Line 6328: “10.116.107.110”
Line 6431: “10.116.106.172”,
Line 6631: “10.116.104.0/27”
Line 6662: “10.116.104.0/23”,
Line 6898: “10.116.106.71”,
Line 6899: “10.116.106.72”,
Line 6900: “10.116.106.39”,
Line 6901: “10.116.106.40”,
Line 6902: “10.116.106.64/27”
Line 6924: “10.116.104.0/27”,
Line 6925: “10.116.105.0/24”,
Line 7062: “10.116.106.172”
Line 7709: “10.116.104.0/27”,
Line 8250: “10.116.10.0/26”
Line 8355: “10.116.10.0/26”
Line 8941: “10.116.101.0/24”
Line 9023: “10.116.104.248/29”,
Line 9024: “10.116.104.0/27”
Line 9097: “10.116.104.0/27”
Line 9532: “10.116.104.0/27”,
Line 9533: “10.116.105.0/24”,
Line 9826: “10.116.105.0/24”,
Line 10468: “10.116.106.172”
Line 10493: “10.116.104.0/27”,
Line 10494: “10.116.105.0/24”,
Line 10519: “10.116.104.0/27”,
Line 10520: “10.116.105.0/24”,
Line 10552: “10.116.104.0/27”,
Line 10553: “10.116.105.0/24”,
Line 10896: “10.116.106.64/27”
Line 10914: “10.116.106.64/27”
Line 10932: “10.116.106.64/27”,
Line 10951: “10.116.106.64/27”,
Line 10952: “10.116.106.48/28”
Line 10973: “10.116.106.64/27”
Line 11365: “10.116.104.0/27”,
Line 11366: “10.116.105.0/24”,
Line 11585: “10.116.104.0/27”
Line 11941: “10.116.104.0/23”,
Line 12156: “10.116.104.0/23”,
Line 12196: “10.116.104.0/27”,
Line 12216: “10.116.104.0/27”,
Line 12244: “10.116.106.208/28”
Line 12262: “10.116.106.214”,
Line 12263: “10.116.106.215”,
Line 12264: “10.116.106.217”,
Line 12265: “10.116.106.216”,
Line 12266: “10.116.106.212”,
Line 12267: “10.116.106.213”
Line 12272: “10.116.104.0/23”,
Line 12288: “10.116.106.216”,
Line 12289: “10.116.106.217”,
Line 12290: “10.116.106.212”,
Line 12291: “10.116.106.213”,
Line 12292: “10.116.106.214”,
Line 12293: “10.116.106.215”
Line 12327: “10.116.102.190”
Line 12387: “10.116.109.62”
Line 12605: “10.116.102.0/26”
Line 12624: “10.116.102.0/26”
Line 12642: “10.116.102.0/26”
Line 12660: “10.116.102.64/28”
Line 12678: “10.116.102.64/28”
Line 12696: “10.116.102.64/28”
Line 12716: “10.116.102.64/28”
Line 12719: “10.116.104.0/27”,
Line 12720: “10.116.105.0/24”,
Line 12736: “10.116.102.64/28”
Line 12755: “10.116.102.64/28”
Line 12782: “10.116.102.64/28”
Line 12901: “10.116.105.0/24”,
Line 12903: “10.116.104.0/27”
Line 12963: “10.116.105.0/24”,
Line 12965: “10.116.104.0/27”
Line 12983: “10.116.106.208/28”
Line 13125: “10.116.106.224/28”
Line 13164: “10.116.104.0/23”,
Line 13233: “10.116.106.208/28”
Line 13253: “10.116.106.224/28”
Line 13268: “10.116.106.224/28”
Line 13286: “10.116.106.208/28”
Line 13304: “10.116.106.208/28”
Line 13322: “10.116.106.224/28”
Line 13325: “10.116.104.0/27”,
Line 13326: “10.116.105.0/24”,
Line 13342: “10.116.106.208/28”
Line 13345: “10.116.104.0/27”,
Line 13346: “10.116.105.0/24”,
Line 13362: “10.116.106.208/28”
Line 13414: “10.116.104.0/23”,
Line 13416: “10.116.105.0/24”
Line 13644: “10.116.104.0/27”,
Line 13645: “10.116.105.0/24”,
Line 13779: “10.116.102.69”
Line 13874: “10.116.106.164”,
Line 13894: “10.116.106.164”,
Line 13964: “10.116.102.224/28”
Line 14000: “10.116.102.208/28”
Line 14207: “10.116.10.224/27”
Line 14375: “10.116.104.0/27”,
Line 14376: “10.116.105.0/24”,
Line 14748: “10.116.102.190”
Line 14881: “10.116.104.0/27”,
Line 14882: “10.116.105.0/24”,
Line 15373: “10.116.106.172”
Line 15394: “10.116.105.19”,
Line 15395: “10.116.104.0/27”,
Line 15524: “10.116.106.160/29”
Line 15635: “10.116.104.0/27”,
Line 15636: “10.116.105.0/24”,
Line 16718: “10.116.107.0/24”
Line 16815: “10.116.107.128/25”
Line 16841: “10.116.107.0/24”
Line 16872: “10.116.107.0/24”
Line 16922: “10.116.107.0/24”
Line 17221: “10.116.105.0/24”,
Line 17299: “10.116.105.0/24”,
Line 17395: “10.116.104.0/27”,
Line 17396: “10.116.105.0/24”,
Line 17512: “10.116.104.0/27”,
Line 17513: “10.116.105.0/24”,
Line 17661: “10.116.106.0/25”
Line 17688: “10.116.102.224/28”
Line 17706: “10.116.102.224/28”
Line 17725: “10.116.102.224/28”
Line 17764: “10.116.102.128/26”
Line 17782: “10.116.102.128/26”
Line 17797: “10.116.102.208/28”
Line 17857: “10.116.102.190” -
@Hardik-Shah said in How to find string in range?:
If the range is like this how can I narrow it range from - 10.116.10.0 - 10.116.10.31 ?
Forgive me but… it’s better if you try first, otherwise you will be asking these questions forever.
Take a look at the previous expression:
10\.116\.106\.2(0[8-9]|1\d|2[0-3])
and try to understand how it works. The backslash (
\
) characters before the periods are there because a period has a special meaning in regular expressions (it matches any one character); putting the backslash before it makes it match only an actual period. So the first part of the expression, before the left parenthesis —10\.116\.106\.2
— is matching the part in your original question that never changes.The expression within the parentheses is made up of three parts, separated by vertical bars (
|
). The parentheses are for grouping, and the vertical bars mean or — in this case either0[8-9]
or1\d
or2[0-3]
.An expression like
[0-3]
means any single character from0
to3
, inclusive, in the collating sequence. (The collating sequence is the “natural order” of characters; it can depend on the language and other technicalities, but for digits, it’s always just as you’d expect:0123456789
.)The expression
\d
means any digit (it’s the same as writing[0-9]
).That should be enough that you can attempt to work out the expression you need for yourself. If you still have trouble, let us know what you tried.
-
@Coises my apologies but I did do try it before but maybe I am not doing to correctly
Here is the example for range I am looking to do the search - 10.116.10.0 - 10.116.10.31
10.116.10(0[0-2]|1\d|3[0-1]) but It did not worked.
Maybe you can correct me what I am doing wrong…
-
@Coises Here is another example
for range 10.116.15.32 - 10.116.15.63
I tried following search 10.116.15(3[0-2]|1\d|6[0-3]) but not working as well…
-
10.116.10.0 - 10.116.10.31
10.116.10(0[0-2]|1\d|3[0-1])
what I am doing wrongFirst,
.
means “match any character”, so that’s not what you mean. You should use\.
to match a literal dot character.Second, you didn’t have a dot at all between the 10 and your group, so you are effectively looking for
10.116.10
followed by two more digits (with restrictions), but not looking for a dot in between. Your group say that it wants to match:- either
0
followed by0
or1
or2
- or
1
followed by any digit - or
3
followed
Thus, you are trying to match
10.116.1000
-10.116.1002
- or
10.116.1010
-10.116.1019
- or
10.116.1030
-10.116.1032
----
10.116.15.32 - 10.116.15.63
search10.116.15(3[0-2]|1\d|6[0-3])
Again, you are missing the backslash before all the dots, and you are missing the dot between 15 and the final. And that one will thus match
10.116.1530
-10.116.1532
10.116.1510
-10.116.1519
10.116.1560
-10.116.1569
And you haven’t told the regex anything about the .40-.49 or .50.59 range, so you cannot very well expect those to match (even if you fix the other problems)
Hopefully, this explanation for why your attempts didn’t work, combined with @Coises earlier explanation, will help you understand where you are going wrong.
If you cannot figure it out, the next time you show an example, and what you tried, also try to explain why you think it will work (explaining what every character or group of characters in the regex is doing), and we can then tell you why your explanation is wrong.
But, as you have found, regex is not an easy way to find values within a mathematical range, especially for something complicated like an IP address. Every time you want to change the range, you will have to completely reconfigure your regex, and that’s going to get annoying for you. If you were using a programming language that had a library that can parse/understand IP addresses (any language worth its salt will have such a library), you could much more easily find IPs withing ranges, rather than relying on making a new custom regex for every range you want.
- either