PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > finding non-ascii characters within a string
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
finding non-ascii characters within a string

Réponse
 
LinkBack Outils de la discussion
Vieux 18/10/2007, 16h47   #1
Olav Mørkrid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut finding non-ascii characters within a string

hello

i would like to search a table column for a range of non-ascii
characters, or a particular non-ascii character. how can i do this?

the column can be any string like "hello, world" or "norwegian
characters æøå here".

refer to these pseudo examples:

SELECT * FROM TABLE WHERE COLUMN CONTAINS CHARACTERS BETWEEN 128 and 255;

SELECT * FROM TABLE WHERE COLUMN CONTAINS CHARACTER = 240;

thanks
  Réponse avec citation
Vieux 18/10/2007, 16h55   #2
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: finding non-ascii characters within a string

Hi,

Olav Mørkrid wrote:
> hello
>
> i would like to search a table column for a range of non-ascii
> characters, or a particular non-ascii character. how can i do this?
>
> the column can be any string like "hello, world" or "norwegian
> characters æøå here".
>
> refer to these pseudo examples:
>
> SELECT * FROM TABLE WHERE COLUMN CONTAINS CHARACTERS BETWEEN 128 and 255;
>
> SELECT * FROM TABLE WHERE COLUMN CONTAINS CHARACTER = 240;


See the ASCII() and ORD() functions:

http://dev.mysql.com/doc/refman/5.0/...functions.html

Baron
  Réponse avec citation
Vieux 18/10/2007, 17h09   #3
Ralf Hüsing
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: finding non-ascii characters within a string

Olav Mørkrid schrieb:
> hello
>
> i would like to search a table column for a range of non-ascii
> characters, or a particular non-ascii character. how can i do this?


Maybe via a inverted regular expression [1] like this?:

SELECT * FROM <TABLE> WHERE <COLUMN> RLIKE '[^-, a-zA-Z0-9]'


[1]: http://dev.mysql.com/doc/refman/5.1/en/regexp.html
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h22.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07864 seconds with 11 queries