[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Not a bug, need help coding search&replace on a vector

From: Juergen Sauermann
Subject: Re: [Bug-apl] Not a bug, need help coding search&replace on a vector
Date: Tue, 21 Jun 2016 18:27:36 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Xtian,

how about this:



      ↑⍎')HOST echo "',s,'" | sed s/',from,'/',to,'/g'
I have replaced the ^ in your example because it (and some other characters) have a special meaning in
regular expressions. But the special characters can be easily quoted in APL if needed, for example:


/// Jürgen

On 06/21/2016 05:12 AM, Christian Robert wrote:
Hi, it's not a bug but a request for help,

suppose s="^^^This^is^a^^^^test^^with^^^^^lot^of^blanks^^^^at^beginning^and^^^end^^^^^^"
suppose from="^^^"
suppose to="^"

I need a function who can replace ("^^^" to "^"), or ("^" to "^^^^^^^^") or ("" to "blabla" with limits of source size)  ie: without being lost in infinite loop.

"s" is a character vector, "from" is a character vector, and "to" is a character vector,
both "s", "from" and "to" can be "".

I'm pretty sure this idiom already exist.

if you can help me, please do.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]