Re: PL/PGSQL Regexe - Mailing list pgsql-sql

From rdear
Subject Re: PL/PGSQL Regexe
Date
Msg-id 3BA9BABA.5030407@dev.internal
Whole thread Raw
In response to Re: PL/PGSQL Regexe  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Humm... 7.0.2, I'll upgrade and try again.<br /><br /> Thanks!<br /><br /><br /> Tom Lane wrote:<br /><blockquote
cite="mid:28279.1000909202@sss.pgh.pa.us"type="cite"><pre wrap="">rdear <a class="moz-txt-link-rfc2396E"
href="mailto:rdear@dev.internal"><rdear@dev.internal></a>writes:<br /></pre><blockquote type="cite"><pre
wrap="">I'mdoing a check within a PL/PGSQL function using a regular expression <br />and I get the error:<br
/></pre></blockquote><blockquotetype="cite"><pre wrap="">ERROR:  regcomp failed with error invalid character range<br
/></pre></blockquote><blockquotetype="cite"><pre wrap="">This appears to be because of the underscore "_" character.
Theregex I <br />want to use is ''[A-Za-z0-9_]'' but this doesn't work.<br /></pre></blockquote><pre wrap=""><br
/>Seemsto work for me:<br /><br />regression=# select 'a' ~ '[A-Za-z0-9_]';<br /> ?column?<br />----------<br /> t<br
/>(1row)<br /><br />regression=# select '_' ~ '[A-Za-z0-9_]';<br /> ?column?<br />----------<br /> t<br />(1 row)<br
/><br/>regression=# select ':' ~ '[A-Za-z0-9_]';<br /> ?column?<br />----------<br /> f<br />(1 row)<br /><br />How old
isyour Postgres?  (I can tell by the spelling of the error<br />message that it's not current.)<br /><br />
regards,tom lane<br /><br />---------------------------(end of broadcast)---------------------------<br />TIP 2: you
canget off all lists at once with the unregister command<br />    (send "unregister YourEmailAddressHere" to <a
class="moz-txt-link-abbreviated"href="mailto:majordomo@postgresql.org">majordomo@postgresql.org</a>)<br
/></pre></blockquote><br/> 

pgsql-sql by date:

Previous
From: prinsarian@zonnet.nl (A. Prins)
Date:
Subject: Re: A simple join question that may stump you
Next
From: Frederick Klauschen
Date:
Subject: PARSER ERROR persists ....