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!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.