• 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. Search for particular string in patttern

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 8959
  • 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

Search for particular string in patttern

saurabh96
saurabh96 over 3 years ago

Hello ...

Entry=hiCreateListBoxField(
?name 'Entry
?multipleSelect t
?choices (list "x_y_1 (diodes)" "x_y_10 (clamps)" "x_y_11 (Protections)"  ))

rules_check = buildString(
foreach(mapcar entry form->Entry->value
car(parseString(entry))
)
" "
)
multi_check = parseString(rules_check)
numPat=pcreCompile("\\d")
rules_number=buildString(
foreach(mapcar entry form->Entry->value
pcreExecute(numPat entry)
pcreSubstitute(numPat "&")
)
","
)

when am running above code am getting values of rules_number  = 1,1,1 inspite it should be 1,10,11

where in code its wrong and how can i correct it?

BR,

The

  • Cancel
Parents
  • AurelBuche
    AurelBuche over 3 years ago

    Hi,

    Your pcre is wrong, it can only match one digit (not a full number)

    Add a "+" at the end and it should work correctly

    numPat=pcreCompile("\\d+")

    Note that pcreSubstitute relies on rexMagic, if anywhere in your Virtuoso session (rexMagic nil) is set your code will return "&","&","&" instead of "1","10","11"

    Hope this helps,

    Cheers,

    Aurélien

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 3 years ago in reply to AurelBuche

    Thanks Aurel for guidance..
    What about this ?

    pcreSubstitute(numPat "\\0")   

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • saurabh96
    saurabh96 over 3 years ago in reply to AurelBuche

    Thanks Aurel for guidance..
    What about this ?

    pcreSubstitute(numPat "\\0")   

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to saurabh96
    saurabh96 said:

    What about this ?

    pcreSubstitute(numPat "\\0")

    That will have the same behaviour as using &. Your pattern is wrong either way and this won't fix your incorrect regular expression.

    AurelBuche said:
    Note that pcreSubstitute relies on rexMagic, if anywhere in your Virtuoso session (rexMagic nil) is set your code will return "&","&","&" instead of "1","10","11"

    This is undocumented behaviour, and nobody should write code that depends upon it (I'm pushing for this to be fixed, because I think it's bad behaviour that can cause code to break).

    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