Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: AUTO_TEMPLATE multiple RegEx matches #323

Closed
veripoolbot opened this issue Feb 1, 2011 · 1 comment
Closed

Question: AUTO_TEMPLATE multiple RegEx matches #323

veripoolbot opened this issue Feb 1, 2011 · 1 comment
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Karthikeyan Avudaiyappan
Original Redmine Message: 447 from https://www.veripool.org


 /*
 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]).

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-02-01T19:21:05Z


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)")
 );
 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant