more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Agreed, Cadence bus syntax can be much more complex than
this. However splitting on commas and parsing the contents in '<>' doesn't allow me to identify unique field types. Eg. XI0<15:0> HD_DEC0_B<(7:0)*2> HD_DEC1_B<15:0:2*2> <*2>H<3:0>,<*4>P<1:0> Because this is an cadence array'd instance, the expansion of each field type is different so I need a way to identify this. HD_DEC0_B<(7:0)*2> --> field_type1 HD_DEC1_B<15:0:2*2> --> field_type2 <*2>H<3:0>,<*4>P<1:0> --> field_type3 There are many more different field_types that I need to be able to identify, the above is just an example. What this line expands to is: XI0_15 HD_DEC0_B_7 HD_DEC1_B_15 H_3 XI0_14 HD_DEC0_B_6 HD_DEC1_B_15 H_2 XI0_13 HD_DEC0_B_5 HD_DEC1_B_13 H_1 XI0_12 HD_DEC0_B_4 HD_DEC1_B_13 H_0 XI0_11 HD_DEC0_B_3 HD_DEC1_B_11 H_3 XI0_10 HD_DEC0_B_2 HD_DEC1_B_11 H_2 XI0_9 HD_DEC0_B_1 HD_DEC1_B_9 H_1 XI0_8 HD_DEC0_B_0 HD_DEC1_B_9 H_0 XI0_7 HD_DEC0_B_7 HD_DEC1_B_7 P_1 XI0_6 HD_DEC0_B_6 HD_DEC1_B_7 P_0 XI0_5 HD_DEC0_B_5 HD_DEC1_B_5 P_1 XI0_4 HD_DEC0_B_4 HD_DEC1_B_5 P_0 XI0_3 HD_DEC0_B_3 HD_DEC1_B_3 P_1 XI0_2 HD_DEC0_B_2 HD_DEC1_B_3 P_0 XI0_1 HD_DEC0_B_1 HD_DEC1_B_1 P_1 XI0_0 HD_DEC0_B_0 HD_DEC1_B_1 P_0 For field_type3, I already have a routine that will explode this type and populate an array. However I'd like to have a regular expression that will match all variations of field_type3 but not match my other field_types. Thanks! In reply to Re^2: regular expression help
by pip9ball
|
|