From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103358 invoked by alias); 10 Mar 2017 09:44:59 -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 103348 invoked by uid 89); 10 Mar 2017 09:44:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_00,FOREIGN_BODY1,GIT_PATCH_1,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=avez, ORDER, H*Ad:U*kawa, vous X-HELO: smtps-n.oca.eu Received: from smtps-n.oca.eu (HELO smtps-n.oca.eu) (192.54.174.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Mar 2017 09:44:47 +0000 Received: from [192.168.109.88] (natoca100-13.unice.fr [134.59.100.13]) by smtps-n.oca.eu (Postfix) with ESMTPSA id 2BFA880769; Fri, 10 Mar 2017 10:44:46 +0100 (CET) From: Damien MATTEI To: Per Bothner Subject: Re: error when using split-regex Date: Fri, 10 Mar 2017 09:44:00 -0000 User-Agent: KMail/1.9.6 Cc: kawa References: <201703091131.24188.Damien.Mattei@unice.fr> <20d18612-1193-142a-5db1-ae765f268c5e@bothner.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201703101044.45857.Damien.Mattei@unice.fr> X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00067.txt.bz2 Le Thursday 09 March 2017 20:46:11 Per Bothner, vous avez =E9crit=A0: > 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.tx= t") > >> (define wds-data-str &<{&[wds-url]}) ;; could take a few seconds to G= ET file > >> (define wds-data-str-split (regex-split wds-data-str (string #\return)= )) > > > > Try switching the order of the arguments to regex-split. >=20 > 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: >=20 > java.util.regex.PatternSyntaxException: Dangling meta character '+' near = index 4730 >=20 > That was the clue that the arguments were switched. Confirmed by checkin= g the manual. thank you Per , it works now, i had swapped the args and the line separator was LF and no= t CR: (let* ((marequete "SELECT * FROM Obs ORDER BY Auteur") =09=20=20 (rs ::java.sql.ResultSet #!null) (total '()) (result '()) (wds-url "http://ad.usno.navy.mil/wds/Webtextfiles/wdsnewref.txt") (wds-data-str &<{&[wds-url]}) (str1 (substring wds-data-str 0 30)) (len-wds-data-str (string-length wds-data-str)) ;;(wds-data-str-split (regex-split (string #\return) wds-data-str))=20 (wds-data-str-split (regex-split (string #\linefeed) wds-data-str)) ) =20=20=20=20=20 (display-msg-var-nl "DBtoWebObserversKawa : work : str1 =3D " str1) (display-msg-var-nl "DBtoWebObserversKawa : work : length wds-data-st= r =3D " len-wds-data-str) (display-msg-var-nl "DBtoWebObserversKawa : work : (car wds-data-str-= split) =3D " (car wds-data-str-split)) output in Tomcat log: Aujourd'hui 10:37:21 =20=20=20 DBtoWebObserversKawa : work : str1 =3D WDS Astrometry, Interferometri DBtoWebObserversKawa : work : length wds-data-str =3D 2723073 DBtoWebObserversKawa : work : (car wds-data-str-split) =3D WDS Astrometry, = Interferometric, Linear, Orbit, and DM Catalogs: References Regards, Damien --=20 Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS