• 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

  • Replies 2
  • Subscribers 143
  • Views 42
  • Members are here 0

Delete all characters in string between 2 specific characters

vtboy51
vtboy51 4 hours 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
  • Sign in to reply
  • Andrew Beckett
    Andrew Beckett 3 hours 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
    • Sign in to reply
    • Cancel
  • vtboy51
    vtboy51 3 hours ago in reply to Andrew Beckett

    As always, thank you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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