나는 파일 이름에서 특수 문자를 제거하기 위해 reReplace
을 사용하고 있습니다. 다음 정규식은 내 코드에서 예외 (아래 참조)를 throw합니다. 그러나, 내가 ColdFusion Regex Utility 정규식 문자열을 테스트 할 때 그것은 잘 작동합니다.ColdFusion에서 특수 문자를 제거하는 정규식에 오류가 발생하는 이유는 무엇입니까?
Error Type: Template : [N/A] Error Messages: Invalid CFML construct found on line 29 at column 45. ColdFusion was looking at the following text:
\\ The CFML compiler was processing:
An expression beginning with !, on line 29, column 44.This message is usually caused by a problem in the expressions structure.
내 원래 소스 : 나는 \@
으로 @
기호를 탈출하면 나는이 오류가
Error Messages: Invalid token @ found on line 29 at column 45.
The CFML compiler was processing:
An expression beginning with !, on line 29, column 44.This message is usually caused by a problem in the expressions structure.
:
reReplace(tmpName,"[{}\(\)\^$&%#[email protected]=<>:;,~`'\'\*\?\/\+\|\[\\\\]|\]|\-",'','all')
그리고 오류 : 여기
내 코드입니다 이 정규식 문자열의 경우 : Regex to Strip Special Characters이러한 문자는 허용되어야하므로 .
및 _
이 삭제되었습니다.
당신이'탈출 시도 해 봤나'대신!? –
방금 해봤습니다. 이제 저는 29 행 30 열의 \로 시작하는 표현식을 얻습니다.이 메시지는 대개 표현 구조의 문제로 인해 발생합니다. – eterps