From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66240 invoked by alias); 9 Mar 2017 19:46:37 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 65936 invoked by uid 89); 9 Mar 2017 19:46:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=4730 X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Mar 2017 19:46:34 +0000 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cm41A-0000dZ-R8; Thu, 09 Mar 2017 20:46:32 +0100 Received: from 70-36-239-163.dsl.dynamic.fusionbroadband.com ([70.36.239.163] helo=localhost.localdomain) by mailfront10.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1cm40r-0007V2-Fe; Thu, 09 Mar 2017 20:46:13 +0100 Subject: Re: error when using split-regex To: Damien MATTEI , kawa References: <201703091131.24188.Damien.Mattei@unice.fr> <20d18612-1193-142a-5db1-ae765f268c5e@bothner.com> From: Per Bothner Message-ID: Date: Thu, 09 Mar 2017 19:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20d18612-1193-142a-5db1-ae765f268c5e@bothner.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00062.txt.bz2 On 03/09/2017 11:42 AM, Per Bothner wrote: > On 03/09/2017 02:31 AM, Damien MATTEI wrote: >> Hi, >> >> i have got an error in code when using regex-split, >> here is the code tested here at REPL in kawa 2.1: >> >> (require 'regex) >> >> (define wds-url "http://ad.usno.navy.mil/wds/Webtextfiles/wdsnewref.txt") >> (define wds-data-str &<{&[wds-url]}) ;; could take a few seconds to GET file >> (define wds-data-str-split (regex-split wds-data-str (string #\return))) > > Try switching the order of the arguments to regex-split. What I did is I saved the file, and then trimmed it down until the output would fit in the scroll-back buffer. Then I saw: java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 4730 That was the clue that the arguments were switched. Confirmed by checking the manual. -- --Per Bothner per@bothner.com http://per.bothner.com/