public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* error when using split-regex
@ 2017-03-09 10:31 Damien MATTEI
  2017-03-09 17:57 ` Per Bothner
  2017-03-09 19:43 ` Per Bothner
  0 siblings, 2 replies; 5+ messages in thread
From: Damien MATTEI @ 2017-03-09 10:31 UTC (permalink / raw)
  To: kawa

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)))

result in this error at some point of splitting:

                  ^
        at java.util.regex.Pattern.error(Pattern.java:1955)
        at java.util.regex.Pattern.sequence(Pattern.java:2123)
        at java.util.regex.Pattern.expr(Pattern.java:1996)
        at java.util.regex.Pattern.group0(Pattern.java:2905)
        at java.util.regex.Pattern.sequence(Pattern.java:2051)
        at java.util.regex.Pattern.expr(Pattern.java:1996)
        at java.util.regex.Pattern.compile(Pattern.java:1696)
        at java.util.regex.Pattern.<init>(Pattern.java:1351)
        at java.util.regex.Pattern.compile(Pattern.java:1028)
        at kawa.lib.kawa.regex.regexSplit(regex.scm:51)
        at atInteractiveLevel-6.run(stdin:6)
        at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:293)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:212)
        at kawa.Shell.run(Shell.java:291)
        at kawa.Shell.run(Shell.java:203)
        at kawa.Shell.run(Shell.java:184)
        at kawa.repl.processArgs(repl.java:687)
        at kawa.repl.main(repl.java:793)

also tested it with #\linefeed and same error, also tested with " " and "A" : error

i did not look in the contain of the file and i will do it,but anyway the result should not be an error?
does the newest version of kawa give a different result?

Regards,
Damien
-- 
Damien.Mattei@unice.fr, Damien.Mattei@oca.eu, UNS / OCA / CNRS

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-10  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 10:31 error when using split-regex Damien MATTEI
2017-03-09 17:57 ` Per Bothner
2017-03-09 19:43 ` Per Bothner
2017-03-09 19:46   ` Per Bothner
2017-03-10  9:44     ` Damien MATTEI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).