• 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. skill substrings replace operation

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 15422
  • 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

skill substrings replace operation

tyanata
tyanata over 11 years ago

 Hello,

I have following question, how can be done in skill following sub-string replace operation:

perl -p -e 's|/folder_level1/folder_level2/[^ ]*/spectre/|\$SOMEVAR/spectre/|g'

 

Best regards,

 

tyanata

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Hi tyanata,

    With sourceString as the string you wish to replace:

    pat=pcreCompile("/folder_level1/folder_level2/[^ ]*/spectre/")
    newString=pcreReplace(pat sourceString "$SOMEVAR/spectre/" 0)

    The 0 at the end of pcreReplace replaces all occurrences of the pattern.

    If using IC5141, the pattern is simple enough you could use the old rex functions:

    rexCompile("/folder_level1/folder_level2/[^ ]*/spectre/")
    newString=rexReplace(sourceString "$SOMEVAR/spectre/" 0)

    However, the pcre (Perl Compatible Regular Expression) functions are more powerful.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 11 years ago

     Thanks Andrew!

     I was afraid that skill will not interpret the meaning of 

    [^ ]* 

    perl regualar expression, but seems I am wrong.

    tyanata

     

    • 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