Unix Technical Forum

AREs in substring(from)

This is a discussion on AREs in substring(from) within the Pgsql General forums, part of the PostgreSQL category; --> As the documentation leads me to expect, my Postgresql 7.4 installation produces: select substring('Bar, Foo' FROM '.') -> 'B' ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 06:33 PM
Brandon Craig Rhodes
 
Posts: n/a
Default AREs in substring(from)

As the documentation leads me to expect, my Postgresql 7.4
installation produces:

select substring('Bar, Foo' FROM '.') -> 'B'

but even though my regex_flavor = advanced,

select substring('Bar, Foo' FROM '\\w') -> NULL
select substring('Bar, Foo' FROM '***:\\w') -> NULL

whereas I expect these to produce 'B' as well. What am I missing?

--
Brandon Craig Rhodes http://www.rhodesmill.org/brandon
Georgia Tech brandon@oit.gatech.edu


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 06:34 PM
Tom Lane
 
Posts: n/a
Default Re: AREs in substring(from)

Brandon Craig Rhodes <brandon@oit.gatech.edu> writes:
> As the documentation leads me to expect, my Postgresql 7.4
> installation produces:
> select substring('Bar, Foo' FROM '.') -> 'B'
> but even though my regex_flavor = advanced,
> select substring('Bar, Foo' FROM '\\w') -> NULL
> select substring('Bar, Foo' FROM '***:\\w') -> NULL
> whereas I expect these to produce 'B' as well. What am I missing?


[ scratches head... ] It works for me.

regression=# select substring('Bar, Foo' FROM '\\w');
substring
-----------
B
(1 row)

regression=# select substring('Bar, Foo' FROM '***:\\w');
substring
-----------
B
(1 row)

What locale and encoding are you using?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:00 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com