Print Page | Close Window

SRXTEXT Troubles

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=1335
Printed Date: 23.Apr.2026 at 16:36


Topic: SRXTEXT Troubles
Posted By: msa81
Subject: SRXTEXT Troubles
Date Posted: 18.Nov.2008 at 16:06
Hi,
 
I am trying to use SRXTEXT to remove control characters from MTEXT. The colour control characters are something like this: {\\C255; or {\\C2; or just file://\\C2 - \\C2 ;
 
I have successfully use the regexp from the command line however I would like to construct a lisp routine but the program seems to function differently. For example.
 
entering the commands:
srxtext
r
\(.\){\\C[0-9];\(.\)
\1\2
L
A
 
will replace "texttext{\\C2;text}text" with "texttexttext}text"
 
this works correctly but if I try to do this:
 
(srxtext "Regular" "\(.\){\\C[0-9];\(.\)" "\1\2" "All")
 
it will return 0. I have managed to get the following to work
 
(srxtext "Regular" "\{\\\\C[0-9];" "###" "All")
 
which will replace {\\C2; with "###" but
 
(srxtext "Regular" "\(.\)\{\\\\C[0-9];\(.\)" "\1\2" "All")
 
will also return 0.
 
why does this not work? Could someone please point me in the right direction? thanks very much!



Replies:
Posted By: Vladimir Michl
Date Posted: 18.Nov.2008 at 16:46

Please note that LISP has its own processing of the backslash character so you have to double it again.

The right regexp for this case is:

(srxtext "Regular" " file://\\%28.\\%29\\\\C%5b0-9%5d+;\\%28.\\ - \\(.\\)\\\\C[0-9]+;\\(.\\ )" " file://\\1\\2 - \\1\\2 " "All")



-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: msa81
Date Posted: 18.Nov.2008 at 18:18
I guess I should have realized that! Thanks very much for the quick response.


Posted By: msa81
Date Posted: 19.Nov.2008 at 21:45
I noticed you used the "+" character. Where can I find a list of expressions that SRXTEXT supports?


Posted By: Vladimir Michl
Date Posted: 19.Nov.2008 at 22:12
It is not any special feature of srxText but a standard Posix format of regular expressions.
 
See e.g.:
http://en.wikipedia.org/wiki/Regular_expression - http://en.wikipedia.org/wiki/Regular_expression


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner



Print Page | Close Window