• 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. Allegro X Scripting - Skill
  3. Parse a String with SKILL

Stats

  • Replies 3
  • Subscribers 19
  • Views 10898
  • Members are here 0
More Content

Parse a String with SKILL

leto
leto over 4 years ago

Hello All,

I have a string  C200_2

I would like break it up to separate alphabets, numbers & special characters

The results should be a list ("C" "200" "_" "2")

Is there a build in function of SKILL to do this?

If not, how should I do this manually?

Thanks All

  • Cancel
  • Sign in to reply
Parents
  • B Bruekers
    B Bruekers over 4 years ago

    If you know the format of your input string then you can make a regular expression to 'extract' the values.

    pcre = pcreCompile("(\\w)(\\d+)_(\\d+)")
    pcreExecute(pcre "C200_2")
    pcreSubstitute("\\1")
    pcreSubstitute("\\2")
    pcreSubstitute("\\3")

    Alternatively, there is an undocumented function which seems to do something that you need:

    _alphaNumBreakIntoChunks("C200_2")
    ("C" "200" "_" "2")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • B Bruekers
    B Bruekers over 4 years ago

    If you know the format of your input string then you can make a regular expression to 'extract' the values.

    pcre = pcreCompile("(\\w)(\\d+)_(\\d+)")
    pcreExecute(pcre "C200_2")
    pcreSubstitute("\\1")
    pcreSubstitute("\\2")
    pcreSubstitute("\\3")

    Alternatively, there is an undocumented function which seems to do something that you need:

    _alphaNumBreakIntoChunks("C200_2")
    ("C" "200" "_" "2")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • leto
    leto over 4 years ago in reply to B Bruekers

    Thanks Bruekers!!

    That is exactly what I needed :D

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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