Beefy Boxes and Bandwidth Generously Provided by pair Networks
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
in thread regular expression help by pip9ball

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-25 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found