regex - MySQL - need to find records without a period in them -


i've been regexp page on mysql website , having trouble getting query right. have list of links , want find invalid links not contain period. here's code doesn't work:

select * `links` (url regexp '[^\\.]') 

it's returning rows in entire database. want show me rows 'url' doesn't contain period. help!

your regexp matches contains character isn't period. if contains foo.bar, regexp matches f , succeeds. can do:

where url regexp '^[^.]*$' 

the anchors , repetition operator make check every character not period. or can do:

where locate(url, '.') = 0 

btw, don't need escape . when it's inside [] in regexp.


Comments