• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Regular Expression Matching Excluded Elements

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 15218
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Regular Expression Matching Excluded Elements

KGh94
KGh94 over 7 years ago

Hello,

I am working with the regular expressions in SKILL, and I'm trying to get the unmatched elements:

myList = '("te_mypattern_xt_1" "text_2" "text_3" "te_mypattern_xt_3" "te_mypattern_xt_3")
exclusionList = rexMatchList("mypattern" myList)
inclusionList = ??

In Python it is possible to use the negate operator "!mypattern", but I don't see something similar in the documentation. Any hints would be appreciated.

Best regards,
Karam

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Karam,

    The ancient "rex" functions certainly wouldn't support this, but looking at even the newer pcre (Perl-Compatible Regular Expressions) functions, they don't seem to have an inverted form. It's easy enough to write one though:

    procedure(CCFnegMatchList(pattern lst)
      let(((pat pcreCompile(pattern)))
        setof(elem lst !pcreExecute(pat elem))
      )
    )

    I did it this way rather than just using setof(elem lst !pcreMatchp(pattern elem)) because this way you're compiling the pattern just once, which makes it a more efficient.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    Thanks Andrew. What's the difference between pcreMatchp and rexMatchp?

    Best regards,
    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    Thanks Andrew. What's the difference between pcreMatchp and rexMatchp?

    Best regards,
    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to KGh94

    Karam,

    pcreMatchp uses perl-compatible regular expressions - which are very powerful and quite extensive (see "man perlre"). The rexMatchp uses (very) basic regular expressions.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information