I have a very big source file, we lines like this:
force `RX_PHY_HIER.rxtriggeresc_0 = test_vector[310:307] ;
force `RX_PHY_HIER.rxtriggeresc_1 = test_vector[314:311] ;
force `RX_PHY_HIER.rxtriggeresc_2 = test_vector[318:315] ;
force `RX_PHY_HIER.rxtriggeresc_3 = test_vector[322:319] ;
What I need is to change that into:
force `RX_PHY_HIER.rxtriggeresc_0 = test_vector[310:307] ;
force `RX_PHY_HIER.rxtriggeresc_1 = test_vector[314:311] ;
`ifdef THREELANES
force `RX_PHY_HIER.rxtriggeresc_2 = test_vector[318:315] ;
`ifdef FOURLANES
force `RX_PHY_HIER.rxtriggeresc_3 = test_vector[322:319] ;
`endif
`endif
I mean, I need to encapsulate all the lines with _2 and _3.
I have thousands of these in my code, so I think I need to use a regular expression.
I can select the whole line containing _2 using ^._2.$ but what I don't know, is to replace one into into the selected line plus a new one(below or above).
Can you please help me?