On Saturday 01 March 2008 10:10:54 am Hans Nowak wrote:
> Disclaimer: I'm still rather new to Chicken, etc, but it seems to me that
> things would be clearer using a regex-literal:
>
> #;6> (use regex-literals)
> ; loading /usr/local/lib/chicken/3/regex-literals.so ...
> #;7> (string-match #/^\\(.*)\s*$/ "\\foo ")
> ("\\foo " "foo ")
>
> Of course the .* match is greedy, so it matches any spaces after "foo" as
> well, which may or may not be your (Matthew's) intention.  If not, this
> might work:
>
> #;8> (string-match #/^\\(.*?)\s*$/ "\\foo ")
> ("\\foo " "foo")

regex-literals looks great! I hadn't noticed it before. Thanks for pointing 
it out.


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to