AutoCAD 2021 gives a different result for Regular Expression

AutoCAD 2021 gives a different result for Regular Expression

david_rock
Enthusiast Enthusiast
726 Views
0 Replies
Message 1 of 1

AutoCAD 2021 gives a different result for Regular Expression

david_rock
Enthusiast
Enthusiast

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

 

0 Likes
727 Views
0 Replies
Replies (0)