Символ @
(выделен жирным шрифтом) в строке замены моего RegEx s / << [\ w | + | @ | #] + >> / \ s * (<< [\ w | \ + | # <strong>| @ ] + >>) \ s * / вызывает ошибку. Когда я заменяю RegEx на s / << [\ w | + | @ | #] + >> / \ s * (<< [\ w | \ + | #] + >>) \ s * /, возникает ошибка уходит.
Как замаскировать символ @
. %NRSTR
не похоже на работу.
КОД:
Data _NULL_;
a=prxchange(%NRSTR("s/<<[\w|\+|@|#]+>>/\s*(<<[\\w|\\+|#|@]+>>)\s*/"), -1, "<<A>> <<A+>> <<A@>> <<A@+>> <<A#>> <<A#+>>");
putlog a;
run;
LOG:
ERROR: An array reference was found in replacement text
"s/<<[\w|\+|@|#]+>>/\s*(<<[\\w|\\+|#|@]+>>)\s*/". Array references within replacement text
are not supported.
ERROR: The regular expression passed to the function PRXCHANGE contains a syntax error.
NOTE: Argument 1 to function PRXCHANGE('s/<<[\w|\+|@'[12 of 46 characters shown],-1,'<<WORD>>
<<W'[12 of 60 characters shown]) at line 1656 column 3 is invalid.
a= _ERROR_=1 _N_=1