Common lisp CL-PPCRE Unicode属性

Common lisp CL-PPCRE Unicode属性,common-lisp,cl-ppcre,Common Lisp,Cl Ppcre,我正试图使用CL-PPCRE库找到这个简单Perl代码的解决方案: if (/\p{Space}/){ print "This string has some spaces\n"; } 我是CL-PPCRE的新手,尝试过: (scan "\\p{\\#Space}" "The String has some white spaces") );我在说属性#/空间不存在时出错 如何执行等效项?库中的cl-ppcre不要求您(至少在空间上)使用任何特殊常量 (if (cl-ppcre:s

我正试图使用CL-PPCRE库找到这个简单Perl代码的解决方案:

if (/\p{Space}/){
  print "This string has some spaces\n";
}
我是CL-PPCRE的新手,尝试过:

   (scan "\\p{\\#Space}" "The String has some white spaces")
);我在说属性#/空间不存在时出错


如何执行等效项?

库中的
cl-ppcre
不要求您(至少在空间上)使用任何特殊常量

(if (cl-ppcre:scan " " "alle meine entchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does have spaces

(if (cl-ppcre:scan " " "allemeineentchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does not have spaces

就可以了。

库不需要您(至少在空间上)使用任何特殊常量

(if (cl-ppcre:scan " " "alle meine entchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does have spaces

(if (cl-ppcre:scan " " "allemeineentchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does not have spaces

就可以了。

库不需要您(至少在空间上)使用任何特殊常量

(if (cl-ppcre:scan " " "alle meine entchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does have spaces

(if (cl-ppcre:scan " " "allemeineentchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does not have spaces

就可以了。

库不需要您(至少在空间上)使用任何特殊常量

(if (cl-ppcre:scan " " "alle meine entchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does have spaces

(if (cl-ppcre:scan " " "allemeineentchen")
    (FORMAT T "Does have spaces~%")
    (FORMAT T "Does not have spaces~%"))
> Does not have spaces

就可以了。

perl regexp
/\p{Space}/
匹配的不仅仅是“”。碳纤维

一种方法是只使用
\s
表达式:

(cl-ppcre:scan "\\s" (format nil "hi~Cthere" #\return))
要使用整个unicode空间类,请执行以下操作:

(ql:quickload :cl-unicode)
(cl-ppcre:scan "\\p{Space}" (format nil "hi~Cthere" #\return))

请参阅CL-PPCRE文档。

perl regexp
/\p{Space}/
匹配的不仅仅是“”。碳纤维

一种方法是只使用
\s
表达式:

(cl-ppcre:scan "\\s" (format nil "hi~Cthere" #\return))
要使用整个unicode空间类,请执行以下操作:

(ql:quickload :cl-unicode)
(cl-ppcre:scan "\\p{Space}" (format nil "hi~Cthere" #\return))

请参阅CL-PPCRE文档。

perl regexp
/\p{Space}/
匹配的不仅仅是“”。碳纤维

一种方法是只使用
\s
表达式:

(cl-ppcre:scan "\\s" (format nil "hi~Cthere" #\return))
要使用整个unicode空间类,请执行以下操作:

(ql:quickload :cl-unicode)
(cl-ppcre:scan "\\p{Space}" (format nil "hi~Cthere" #\return))

请参阅CL-PPCRE文档。

perl regexp
/\p{Space}/
匹配的不仅仅是“”。碳纤维

一种方法是只使用
\s
表达式:

(cl-ppcre:scan "\\s" (format nil "hi~Cthere" #\return))
要使用整个unicode空间类,请执行以下操作:

(ql:quickload :cl-unicode)
(cl-ppcre:scan "\\p{Space}" (format nil "hi~Cthere" #\return))

请参阅CL-PPCRE文档。

我尝试了您的代码,它总是生成零:(CL-PPCRE:scan“\\p{Space}”(格式t“hi~Cthere”#\return))我尝试了以下操作,但它总是生成零:(如果(CL-PPCRE:scan“\\p{Space}”这里有一个空格)(打印“Success!”)=>如果(cl ppcre:scan“\\p{Digit}”“有一个数字411”)(打印“Success!”);=>无{which}似乎不起作用?注意(格式t…)打印到
*标准输出*
,(格式nil…)写入一个新字符串。我尝试了您的代码,它总是生成nil:(cl ppcre:scan“\\p{Space}”(格式t“hi~Cthere”\return))我尝试了以下操作,但它总是生成一个nil:(if(cl ppcre:scan”\\p{Space}“这里有一个空格。”)(print“Success!”);=>NIL如果(cl-ppcre:scan“\\p{Digit}”有一个数字411”)(print“Success!”);=>NIL.{不管什么}似乎不起作用?注意(格式t…)打印到
*标准输出*
,(格式NIL…)写入一个新字符串。我试过你的代码,它总是生成NIL:(cl-ppcre scan:scan”\\p{space}”(格式t“hi~Cthere”#\return))我尝试了以下方法,但它总是产生一个NIL:(如果(cl-ppcre:scan“\\p{Space}”“这里有一个空格。”)(print“Success!”);=>NIL如果(cl-ppcre:scan“\\p{Digit}”“有一个数字411”)(print“Success!”);=>NIL.{which what}似乎不起作用?注意(格式t*打印到
标准输出*
,(format nil…)写入一个新字符串。我尝试了你的代码,它总是生成nil:(cl-ppcre:scan“\\p{Space}”(format t“hi~Cthere”#\return))我尝试了以下操作,但它总是生成一个nil:(if(cl-ppcre:scan“\\p{Space}”这里有一个空格)。(print“Success!”;=>nil-if(cl-ppcre:scan“\\p{digital}”有一个数字411”)(print”成功!);=>nil.{无论如何}似乎不起作用?注意(格式t…)打印到
*标准输出*
,(格式nil…)写入新字符串。