Hi,
I encountered a problem using "regexpr". The code
works fine in R, but not in S-Plus:
when run in R, it shows what I wanted (and it make
sense as well):
> regexpr("(JA)?[0-9]+","JA87")
[1] 1
attr(,"match.length")
[1] 4
but if I try it in S-Plus:
> regexpr("(JA)?[0-9]+","JA87")
[1] -1
attr(, "match.length"):
[1] -1
Basically, I wanted to match a pattern where there
might be letters "JA" preceding some numbers. Is there
something wrong with my code, or this a bug is S-Plus?
Thanks
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|