片云天共远永夜月同孤


On Sat, Jun 27, 2009 at 2:17 AM, Chris Dean <ctdean@sokitomi.com> wrote:

Xiangjun Wu <netawater@gmail.com> writes:
> (cl-ppcre:scan
>               (cl-ppcre:create-scanner
>                  "(_\\w+)*\\@\\w+") "______________________________________"
>                           :start 0)
>


Perhaps

 (cl-ppcre:create-scanner "(_[_\\w]+)?@\\w+")

will work for your app?  The problem in the original expression is the
"+" followed by the "*" can lead to a combinatorial explosion.

If you loosen the requirement that all non-zero matches in the first
expression must begin with an "_" you could have:

 (cl-ppcre:create-scanner "[_\\w]*@\\w+")

Cheers,
Chris Dean

_______________________________________________
cl-ppcre-devel site list
cl-ppcre-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/cl-ppcre-devel

Thank you, it works for our application.