Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0409F632919 for ; Wed, 24 Mar 2010 15:58:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 40610-03 for ; Wed, 24 Mar 2010 18:58:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mail.postgresql.org (Postfix) with ESMTP id E5D3463334C for ; Wed, 24 Mar 2010 15:58:29 -0300 (ADT) Received: by ey-out-2122.google.com with SMTP id d26so609598eyd.33 for ; Wed, 24 Mar 2010 11:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=NC0eNqX+JL6n8HlyVvINRzbpMYGfZ1asiPbp7++l3hA=; b=ultuVyxXfMc8/+V1wj6vnUasWDfDhK1whwtlmISjBj6sxeS4DFyW9aqVq60xMMWH9B vK3glgl/Qe25AQUsP1ywQ1ZPQY/25offUdCAt988Y+gIfBeAyOJ2woNKI5bHzidCEtX9 0mHcuuCqhTRqp8tWxqrZwzRwHD9WtuO9lwMKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eGniTLRHNMtXA0Gm5vibDt0TfBuz3u4cOZleqjTyfE8mkohfC0bwaJUyjayI0PSmmH j0QJwx8HLelf2v6yVXX/riIgxk/abIa3hMzsPgxdhzFxLtjpaCYjPvCfLCMEoTg5PZzs NdwRAtWyysCmuePp9N7gEd5zQ2QP60DE8Ta+c= MIME-Version: 1.0 Received: by 10.213.23.19 with HTTP; Wed, 24 Mar 2010 11:58:28 -0700 (PDT) Date: Wed, 24 Mar 2010 19:58:28 +0100 Received: by 10.213.38.207 with SMTP id c15mr2182017ebe.16.1269457108470; Wed, 24 Mar 2010 11:58:28 -0700 (PDT) Message-ID: Subject: Help with reg_exp From: John Gage To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=00163600d5fe020dfd0482908437 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.109 tagged_above=-10 required=5 tests=BAYES_05=-1.11, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/192 X-Sequence-Number: 33899 --00163600d5fe020dfd0482908437 Content-Type: text/plain; charset=ISO-8859-1 [I mistakenly used the wrong Subject line initially with this post] In going through the arcana of string functions, I have come across the following series of selects that contain, for me, a mysterious "$re$". -- return all matches from regexp SELECT regexp_matches(' foobarbequebaz', $re$(bar)(beque)$re$); -- test case insensitive SELECT regexp_matches('foObARbEqUEbAz', $re$(bar)(beque)$re$, 'i'); -- global option - more than one match SELECT regexp_matches('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g'); When I run this I get: regexp_matches -------------------------- I have not been able to find out what it all means. Forgive me for my blindness. John P.S. The author of the statements is "alexk" at Command Prompt. They are test statements against Postgres' string functions. --00163600d5fe020dfd0482908437 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [I mistakenly used the wrong Subject line initially with this post]

= In going through the arcana of string functions, I have come across the=20 following series of selects that contain, for me, a mysterious "$re$&q= uot;.

-- return all matches from regexp
SELECT regexp_matches('
foobarbe= quebaz', $re$(bar)(beque)$re$);

-- test case insensitive
SELECT regexp_matches('foObARbEqUEbAz&#= 39;, $re$(bar)(beque)$re$, 'i');

-- global option - more than on= e=20 match
SELECT regexp_matches('foobarbequebazilbarfbonk',=20 $re$(b[^b]+)(b[^b]+)$re$, 'g');

When I run this I get:

regexp_matches
-----------------------= ---
<Unknown(2,003)>

I have not been able to find out what it all means.=A0 Forgive me for my=20 blindness.

John

P.S. The=20 author of the statements is "alexk" at Command Prompt.=A0 They ar= e test=20 statements against Postgres' string functions.
--00163600d5fe020dfd0482908437--