On Jun 25, 9:21 pm, Edi Weitz <e...(a)agharta.de> wrote:
> The question is - what do you want to achieve with this regular
> expression? Can't you write it in a simpler way?
Isn't this pattern pretty useful in general:
A@B
where A and B are word characters and @ is a specific non-word
character?
How else could we specify it?
[a-zA-Z0-9] doesn't seem acceptable to me since it relies on
the latin alphabet...
Leslie
--
http://www.linkedin.com/in/polzer
In order to fix issue of montezuma,
http://code.google.com/p/montezuma/issues/detail?id=3, I suppose I found a
bug of cl-ppcre.
CL-USER> (cl-ppcre:scan
(cl-ppcre:create-scanner
"(\\w+)*\\@\\w+") "______________________________________"
:start 0)
;; Evaluation aborted.
It hangs when the number of underscore hit a critical value.
I speculate that '\w' includes underscore in regular expression would
account for this
bug. and replace with other character of '\w' also has this problem.
CL-USER> (cl-ppcre:scan (cl-ppcre:create-scanner
"(a\\w+)*\\@\\w+")
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
:start 0)
;; Evaluation aborted.
but if I eliminate the last \w, it is OK.
CL-USER> (cl-ppcre:scan
(cl-ppcre:create-scanner
"(_\\w+)*\\@") "_______________________________________"
:start 0)
NIL
I also check it in perl, Maybe perl is more efficient in regular expression
operation, I raise the number of
underscores, but it is OK.
$str = "john._______________________________________
__________________________________";
if ($str =~ m/(_*\w+)*\@\w+/)
{
print "ok\n";
}
Please check it and give your comment.
片云天共远永夜月同孤
I've created a spec file which can be used to build an RPM for CL-PPCRE;
it uses common-lisp-controller and _should_ work on any clc-supporting
Fedora Lisp. I'm willing to volunteer to maintain the spec file and
figure out how to submit RPMs to the Fedora Project; is that okay?
--
Robert Uhl <http://public.xdi.org/=ruhl>