This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: error when using split-regex
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/