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

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 15576
  • 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

Pattern matching

Sridhar123
Sridhar123 over 12 years ago

 Hello all,

I have a small query on pattern matching . Actually I am trying to search for the data in between two keywords say "REVA" and "REVB" from the userdefined input data (assumed that the keywords "REVA" , "REVB ... are always present in the input data without duplicates or repetitions) . Is there a way that I search the user defined input data  for two keywords "REVA" and "REVB" and what ever the data inbetween this two words has to be dumped in to a variable REVA , similarly whatever the data that is present in between "REVB" and "REVC" to REVB field  etc , ineffective I am seperating the respective revision data to their corresponding fields from the given input data.

May be the following ex gives more info:

;Skill starts here 

 procedure(testpattern()
inputdata = "REVA: This Text belongs to revision A \n REVB: This Text belongs \n to revision B. REVC: This \n Text belongs to revision C"
input = hiCreateMLTextField(?name 'input ?prompt "INPUT" ?value inputdata  ?hasVerticalScrollbar nil ?hasHorizontalScrollbar nil)
REVA = hiCreateMLTextField(?name 'REVA ?prompt "REVA" ?value ""  ?hasVerticalScrollbar nil ?hasHorizontalScrollbar nil)
REVB = hiCreateMLTextField(?name 'REVB ?prompt "REVB" ?value ""  ?hasVerticalScrollbar nil ?hasHorizontalScrollbar nil)
REVC = hiCreateMLTextField(?name 'REVC ?prompt "REVC" ?value ""  ?hasVerticalScrollbar nil ?hasHorizontalScrollbar nil)
fillform=hiCreateButton(?name 'fillform ?buttonText "Fill Form" ?callback "fillform()")
testform = hiCreateAppForm(
     ?name 'testform
     ?formTitle "Pattern Matching"
     ?fields list(
                    list(input  15:15  400:70 50)
                    list(REVA  15:100  400:20 50)
                    list(REVB  15:150  400:20 50)
                    list(REVC  15:200  400:20 50)
                    list(fillform  15:260  100:30 50))

?initialSize t
)
hiDisplayForm(testform)
)

 ; ends here 

 

Now what I require is the fillform() function must put the data say " This Text belongs to revision A" in to REVA field by searching the input data. Similarly for other fields "REVB" "REVC".

I have tried using rexMatchp() and other pattern matching functions but the return value is always a t or nil but not the data.

Is there a way to achieve this.

Thank you very much in advance for your time.

 

Best regards,

Sri. 

  • Cancel
Parents
  • Sridhar123
    Sridhar123 over 12 years ago

     Hello Andrew,

     

    Yeah , you were correct I was just looking for  only parts of the text editable , so that the user wouldn't edit "REVA" . If REVA have been edited than I would  have problem while loading back the data.

    However I could solve this by ensuring that before printing the data to the file I am checking if there is "REVA:" or "REVB:" at the beginning of the correspoding field otherwise I am appending and then printing the data.So that I won't have any issue while loading the data back from the file.

     

    Andrew thank you very much for your support. 

     

    Best regards,

    Sridhar.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Sridhar123
    Sridhar123 over 12 years ago

     Hello Andrew,

     

    Yeah , you were correct I was just looking for  only parts of the text editable , so that the user wouldn't edit "REVA" . If REVA have been edited than I would  have problem while loading back the data.

    However I could solve this by ensuring that before printing the data to the file I am checking if there is "REVA:" or "REVB:" at the beginning of the correspoding field otherwise I am appending and then printing the data.So that I won't have any issue while loading the data back from the file.

     

    Andrew thank you very much for your support. 

     

    Best regards,

    Sridhar.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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