Regexp matching - Mailing list pgsql-sql

From Eduardas Kazakas
Subject Regexp matching
Date
Msg-id AANLkTin+K709+5M0MjHHGW_Z5WZba_v_60VcEWDq7GZB@mail.gmail.com
Whole thread Raw
Responses Re: Regexp matching  (Osvaldo Kussama <osvaldo.kussama@gmail.com>)
List pgsql-sql
Hello, I have some problems using character class matching (e.g. [:alpha:]).<br /><br />For example I have a table:<br
/><br/>CREATE TABLE re_test (text_column character varying (50) NOT NULL);<br /><br />Notice, that there are some
specificcharacters.<br /><br />INSERT INTO re_test VALUES ('AŠDF');<br />INSERT INTO re_test VALUES ('AŠDF45');<br
/>INSERTINTO re_test VALUES ('AŠDF FDŠA');<br />INSERT INTO re_test VALUES ('ASDF FDŠA');<br />INSERT INTO re_test
VALUES('58ASDF FDŠA');<br /> INSERT INTO re_test VALUES ('ašDf');<br />INSERT INTO re_test VALUES ('aŠdf');<br /><br
/>SELECT* FROM re_test WHERE text_column ~ '[^[:alpha:]]' and text_column ~ [:upper:];<br /><br />Goal:<br />I want to
writesuch statement which returns me only those records which have only one word and those words must be uppercase.<br
/>So I expect this statement to return only one record where text_column = AŠDF.<br /><br />Maybe someone could give me
moredetail explanation how to use those regexp classes, because the documentation tells very little about this.<br
/><br/>Some more information:<br /><br />PostgreSQL9<br /><br />OS - Windows x86-32<br />DB encoding - UTF-8<br
/>lc_collate- English_United States.1252<br />lc_ctype - English_United States.1252<br />lc_messages - English_United
States.1252<br/> lc_monetary - English_United States.1252<br />lc_numeric - English_United States.1252<br />lc_time -
English_UnitedStates.1252  

pgsql-sql by date:

Previous
From: "Thomas Andres"
Date:
Subject: Shema with template
Next
From: Andreas Schmitz
Date:
Subject: Re: identifying duplicates in table with redundancies