How to access multiple capture groups in AUTOINST REGEXP? #1662
Comments
Original Redmine Comment Use backslash 1, 2, 3 etc. Please see https://github.com/veripool/verilog-mode/blob/master/FAQ.adoc#how-do-i-use-auto_template-to-match-multiple-port-names |
Original Redmine Comment What about in the instance name rather than the ports? Or what happens if I have two lots of regex?
In the above example, I want to replace X with the second capture group from the instance name. I want the following:
|
Original Redmine Comment Sorry, thought you were referring to a template of a AUTOINST. The cell name regexp attached to the AUTOINST itself only uses \1 as @. For anything else you need lisp code using vl-cell, see https://github.com/veripool/verilog-mode/blob/master/FAQ.adoc#how-do-i-have-auto_template-use-the-second-number-in-a-instance-name |
Author Name: Shareef Jalloq
Original Redmine Issue: 1662 from https://www.veripool.org
Hi,
I'm wanting to pull out a number of terms from an AUTOINST regexp but can't find an example. If I have two module instance names of "u_tx0" and "u_tx1" with a regext of "_(tx([0-9]))", I'm expecting to see two capture groups. The first would have the full "tx0" or "tx1" ; the second "0" and "1".
How do I access the second capture group? The documentation/manual talks about using multiple groups but only gives the example of using @ to get the first group.
Shareef.
The text was updated successfully, but these errors were encountered: