CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedSRXTEXT Troubles

 Post Reply Post Reply
Author
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Topic: SRXTEXT Troubles
    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.:
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
msa81 View Drop Down
Newbie
Newbie


Joined: 18.Nov.2008
Location: Canada
Status: Offline
Points: 3
Direct Link To This Post Posted: 19.Nov.2008 at 21:45
I noticed you used the "+" character. Where can I find a list of expressions that SRXTEXT supports?
Back to Top
msa81 View Drop Down
Newbie
Newbie


Joined: 18.Nov.2008
Location: Canada
Status: Offline
Points: 3
Direct Link To This Post Posted: 18.Nov.2008 at 18:18
I guess I should have realized that! Thanks very much for the quick response.
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post 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" "\\(.\\)\\\\C[0-9]+;\\(.\\)" "\\1\\2" "All")

Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
msa81 View Drop Down
Newbie
Newbie


Joined: 18.Nov.2008
Location: Canada
Status: Offline
Points: 3
Direct Link To This Post 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 \\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!
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,156 seconds.