Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > REGEXP_REPLACE ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 12 Topic 15781 of 17437
Post > Topic >>

REGEXP_REPLACE woes

by leif@[EMAIL PROTECTED] ("Leif B. Kristensen") Jun 10, 2008 at 01:28 PM

I want to transform the text '[p=1242|John Smith]' to 
<a href="./family.php?person=1242">John Smith</a>, but what I get is:

pgslekt=> select REGEXP_REPLACE('[p=1242|John Smith]',
pgslekt(> E'[p=(\d+)|(.+?)]',
pgslekt(> E'<a href="./family.php?person=\\1">\\2</a>');
                    regexp_replace
------------------------------------------------------
 [<a href="./family.php?person="></a>=1242|John Smith]
(1 row)

What am I doing wrong?

PostgreSQL 8.2.7 on i686-pc-linux-gnu BTW.
-- 
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/
| Cruising with Gentoo/KDE
My Jazz Jukebox: http://www.last.fm/user/leifbk/

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 12 Posts in Topic:
REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-10 13:28:06 
Re: REGEXP_REPLACE woes
mike@[EMAIL PROTECTED] (  2008-06-10 06:10:30 
Re: REGEXP_REPLACE woes
mike@[EMAIL PROTECTED] (  2008-06-10 07:38:49 
Re: REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-10 19:09:27 
Re: REGEXP_REPLACE woes
mike@[EMAIL PROTECTED] (  2008-06-10 07:41:53 
Re: REGEXP_REPLACE woes
mike@[EMAIL PROTECTED] (  2008-06-10 08:07:07 
Re: REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-10 15:43:02 
Re: REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-10 16:10:58 
Re: REGEXP_REPLACE woes
cat@[EMAIL PROTECTED] (C  2008-06-11 00:02:44 
Re: REGEXP_REPLACE woes
tgl@[EMAIL PROTECTED] (T  2008-06-10 10:54:03 
Re: REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-11 11:19:15 
Re: REGEXP_REPLACE woes
leif@[EMAIL PROTECTED] (  2008-06-11 12:24:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:57:38 CST 2008.