Re: Help need using

From: Luis Santos <lsantos_at_pobox.com>
Date: Mon, 26 Aug 2019 09:11:05 -0300
Message-ID: <CAPWdmV8+XOodP6b6+k8NNCJVQWG8DHK8xKuYcLQcF-Ti=j3eaw_at_mail.gmail.com>



Thanks everyone for the gentle and nice replies. Matt, your code was perfect for my needs. Thank you very much!

*--*
*Att*

*Luis Santos*

Em sáb, 24 de ago de 2019 às 08:08, anthony Sanchez < anthonycsanchez_at_gmail.com> escreveu:

> Hi Luis,
> Try doing it in two passes and union the results together.
>
> First pass skips over parameters in double quotes
>
> Union
>
> Second pass only looks at parameters in double quotes and skips the rest.
>
> Anthony
>
> On Thu, Aug 22, 2019, 1:17 PM Luis Santos <lsantos_at_pobox.com> wrote:
>
>> Hello list!
>>
>> First forgive me for not digging into documentation, but I'm not a
>> regular expression expert.
>>
>> I need to perform a simple string parse, to get parameters separeted by
>> white space (or tabs) with unknown count.
>>
>> I reached to this:
>>
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *SQL> select regexp_substr ('Param1 Param2 Param3','[[:graph:]]+', 1,
>>> rownum) Parameter 2 from dual 3 connect by level <= 3 4
>>> /PARAMETER--------------------------------------------------------------------------------Param1Param2Param3*
>>
>>
>> But I need to consider, in special case, a group of words, enclosed with
>> double quotes, as a single parameter.
>>
>> But, of course, this will not work:
>>
>>
>>> *SQL> select regexp_substr ('Param1 "Param2 Param3"','[[:graph:]]+',
>>> 1, rownum) Parameter*
>>> * 2 from dual*
>>> * 3 connect by level <= 3** 4 /*
>>>
>>> *PARAMETER*
>>>
>>> *----------------------------------------------------------------------------------------*
>>> *Param1*
>>> *"Param2**Param3"*
>>
>>
>> How can I get the following output:
>>
>>
>>> *PARAMETER*
>>>
>>> *----------------------------------------------------------------------------------------*
>>> *Param1**"Param2 Param3"*
>>
>>
>> Best regards,
>> Luis Santos
>>
>>
>>
>>
>>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Aug 26 2019 - 14:11:05 CEST

Original text of this message