kp2a has asked for the wisdom of the Perl Monks concerning the following question:
task: seek record that contains a specific IP --- I have
tried:
and so on . . . all same result - many matches where even the first six character do not match - help!select * from table where field regexp '^10.100.1.1' select * from table where field regexp '10\.100\.1\.1' select * from table where field regexp '10\.100\.1\.1[[:>:]]' select * from table where field regexp '[[:<:]]10\.100\.1\.1[[:>:]]'
here is the behavior I expected: mysql> select d07 from service where d07 regexp '10.100.101.95'; +-----------------------------------------+ | d07 | +-----------------------------------------+ | 10.100.101.95 on at 2011-05-24 02:08:49 | | 10.100.101.95 on at 2010-04-24 15:00:04 | +-----------------------------------------+ 2 rows in set (0.05 sec) could it be that there is something magic about 10.100.1.1?mysql> select d07 from service where d07 regexp '^10.100.1.1'; +------------------------------------------------+ | d07 | +------------------------------------------------+ | 10.100.101.186 on at 2011-06-20 02:12:02 | | 10.100.101.188 at 2009-05-12 05:12:47 | | 10.100.101.251 at 2009-03-26 16:00:37 | | 10.100.101.182 at 10282300 | | 10.100.101.70 on at 2011-04-25 02:16:27 | | 10.100.101.59 off since 2012-02-18 18:52:04 | . . .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (OT) mysql regexp unwanted matches for specific IP
by McDarren (Abbot) on Jan 30, 2013 at 12:07 UTC | |
by hippo (Bishop) on Jan 30, 2013 at 14:41 UTC | |
by kp2a (Sexton) on Jan 30, 2013 at 14:46 UTC | |
Re: (OT) mysql regexp unwanted matches for specific IP
by choroba (Cardinal) on Jan 30, 2013 at 15:45 UTC | |
Re: (OT) mysql regexp unwanted matches for specific IP
by keszler (Priest) on Jan 30, 2013 at 15:04 UTC |
Back to
Seekers of Perl Wisdom