[Info-ingres] weird string processing request
Martin Bowes
martin.bowes at ndph.ox.ac.uk
Wed Oct 10 11:51:44 UTC 2018
select substring('tag1:value1|tag2:value2' similar to '%tag1:\"[[:print:]^|]*\"%' escape '\')
Returns: value1
Queue manic laughter.
This is the most fun I've had with a regEx since this beauty I had to code into a perl program: s/"?lust"?\s*\.(?!\s*(archive_|"?id_sequence"?))/"${gUSER}"./mg;
Marty
-----Original Message-----
From: Roy Hann [mailto:specially at processed.almost.meat]
Sent: 09 October 2018 17:07
To: info-ingres at lists.planetingres.org
Subject: Re: [Info-ingres] weird string processing request
Martin Bowes wrote:
> Yes the tag names are known, fixed in order and number.
>
> I'm pretty sure that SIMILAR TO is a search predicate and
> only returns a true false to a where clause and will not return a
> matching value.
You're in for a treat then. :-)
Ingres 11 now has a substring() function which takes a regular
expression. The syntax is
SUBSTRING( s SIMILAR TO pattern ESCAPE esc_character [modifier] )
It's on page 126 of the PDF version of the SQL Reference Guide I
happen to have at hand.
Roy
_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org
https://lists.planetingres.org/mailman/listinfo/info-ingres
More information about the Info-ingres
mailing list