Forum Moderators: open

Message Too Old, No Replies

Detect if there are chars other than those on a certain list

         

BlackDex

1:39 pm on May 15, 2008 (gmt 0)

10+ Year Member



Hello there,

I have a list of chars:

a..zA..Z0..9\r\n\s\t@£$¥èéùìòÇØøÅå_{}~€ÆæßÉ!"#¤%&\'()*+,-./:;<=>?¡ÄÖÑܧ¿äöñüàáâãÁÀÂÃëêËÉÈÊÐïíîÏÍÌÎóôõðÓÒÔÕúûÚÙÛýÝ`…

And i want to retreive all records where there is any other char then one in that list above within a text field.

How can i do this?

rocknbil

5:11 pm on May 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Stow the list in a variable, like $your_list.

select * from table where field not regexp '*[$your_list]*';

I think you'll have to change the first syntax to

A-z0-9

and might have to escape some stuff

\ = \\
\n = \\n
\r = \\r

etc.