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' ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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) |
| ||||
| 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 |