Message 1 of 1
AutoCAD 2021 gives a different result for Regular Expression
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
For the following lisp function in AutoCAD 2021 the second test it only returns:
"ELECTRICAL SERVICES "
however in AutoCAD 2020 it works fine, removed the \\P and returns:
"ELECTRICAL SERVICES COVER SHEET & DRAWING SCHEDUL"
;;
;; (replaceRegExpTest " " "\\\\P|\\n|\\t" "%%chellothere\Phellothere{\C2;sdfasdf}")
;; (replaceRegExpTest " " "\\\\P|\\n|\\t" "ELECTRICAL SERVICES\\PCOVER SHEET & DRAWING SCHEDUL")
;;
(defun replaceRegExpTest (strReplace strFind strOrig)
(if (setq objRegExp (vlax-get-or-create-object "VBScript.RegExp"))
(progn
(vlax-put-property objRegExp 'pattern strFind)
(vlax-invoke objRegExp 'replace strOrig strReplace)
)
)
)
Any ideas?
Regards
David