![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Regexp where string contains literal pipes "|" Topic Summary: Created On: 10-May-2005 19:51 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: You can do it with a regular expression similar to: Regexp Pipes= regexp "[^|]+" | |
![]() |
|
I'm really terrible when it comes to using regular expressions. I'm trying to break down the following string.......
string x = "ERTest200001184 | Test2 DOORS Integration | Assessing | Enhancement | Systems | 1 Highest | 1 Critical Function or Safety | 3 Requirements ERTest200001209 | Test3 DOORS Integration | Opening | Enhancement | Systems | 3 Medium | 3 Adverse - Workaround | 2 Architecture" I was able to split out the ERTest200001184 and ERTest20001209 into a DXL attribute with the attached code. The code returns exactly what I want and was very easy to write as I don't anticipate any other word starting with "ERTest" Now I need to do the same things with the remainder of the string, only showing the Text within specific pipes. Is there a way to count the pipes "|" at the start of each line and only match the text that is in-between the specific counted pipes? For example I would like to display a DXL attribute that contains the text information between the 1 and 2nd pipes. It would return this from string x above. Test2 DOORS Integration Test3 DOORS Integration Edited: 10-May-2005 at 19:53 by Adam Gerber |
|
![]() |
|
![]() |
|
You can do it with a regular expression similar to:
Regexp Pipes= regexp "[^|]+" |
|
![]() |
|
![]() |
|
Thanks Ron,
I'm not going to tell you how stupid I feel! Got it to work. Adam |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.