Re: Help need using

From: Maxim <mdemenko_at_gmail.com>
Date: Thu, 22 Aug 2019 21:50:56 +0200
Message-ID: <CAFP4yMxQG8S8G=sRN02K439QHEBxXsViPDStdx=CvOHA6Wd_Tw_at_mail.gmail.com>



You can try to play around with smth. like

SQL> select regexp_substr ('Param1 "Param2 Param3" Param4','"(\w|\s)+"|\w+', 1, rownum) Parameter   2 from dual
  3 connect by level <= 4
  4 /

PARAMETER



Param1
"Param2 Param3"
Param4

Regards

Maxim

On Thu, Aug 22, 2019 at 9:18 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 Thu Aug 22 2019 - 21:50:56 CEST

Original text of this message