Forums » Using AUTOs »
AUTO_TEMPLATE multiple RegEx matches
Added by Karthikeyan Avudaiyappan over 2 years ago
/* Foo AUTO_TEMPLATE "Foo\([0-9]\)_\([A-Z]\)" ( .OldPortName\([a-z]\) (@[0]NewPortName\1@[1]) ); */
Above I have two RegEx matches in the Instance Name. Is there a way I can remember both of them in such that I can use them both, like I had shown before. i.e. In my usage above, [0] refers to what got matched against \([0-9]\) and @[1] refers to what got matched against \([A-Z]\).
Replies (1)
RE: AUTO_TEMPLATE multiple RegEx matches - Added by Wilson Snyder over 2 years ago
You can't do it in one step, you need to either match the entire name and then use a lisp-substring function to sub-extract, or just use vl-cell-name. If you can't just pick off substrings you'll need to write a lisp function - see examples that use AUTO_LISP under in the faq.
/* Foo AUTO_TEMPLATE( .OldPortName\([a-z]\) (@"(substring vl-cell-name 3 4)"NewPortName\1@"(substring vl-cell-name 5 6)") ); */
(1-1/1)
![[logo]](/img/veripool_small.png)