• 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. Delete all characters in string between 2 specific char...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 149
  • Views 2019
  • 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

Delete all characters in string between 2 specific characters

vtboy51
vtboy51 8 months ago

I'm looking to see if there is a cleaner way to delete all the characters between the  "("  and ")" in the string below. I know it can be done using parseString, but wanted to see if there is a cleaner approach.

"/swr_ithctl/swr_islope(XISLOPE)/swr_islope_ibgrmir(XIBGRMIR)" 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett 8 months ago

    withinParen=pcreCompile("\\([^)]*\\)")
    source="/swr_ithctl/swr_islope(XISLOPE)/swr_islope_ibgrmir(XIBGRMIR)"
    result=pcreReplace(withinParen source "" 0)

    which gives:

    "/swr_ithctl/swr_islope/swr_islope_ibgrmir"

    Explanation of the pattern (I meant to say this when replying - apologies for editing afterwards) - an open parenthesis (has to be escaped because parentheses are used for grouping in PCRE) followed by any number occurrences of any character that is not a close parenthesis, followed by a close parenthesis.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 8 months ago

    withinParen=pcreCompile("\\([^)]*\\)")
    source="/swr_ithctl/swr_islope(XISLOPE)/swr_islope_ibgrmir(XIBGRMIR)"
    result=pcreReplace(withinParen source "" 0)

    which gives:

    "/swr_ithctl/swr_islope/swr_islope_ibgrmir"

    Explanation of the pattern (I meant to say this when replying - apologies for editing afterwards) - an open parenthesis (has to be escaped because parentheses are used for grouping in PCRE) followed by any number occurrences of any character that is not a close parenthesis, followed by a close parenthesis.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • vtboy51
    vtboy51 8 months ago in reply to Andrew Beckett

    As always, thank you.

    • 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.

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

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