Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by ron lewis, on Tuesday, May 10, 2005 9:29 PM

Answer:
You can do it with a regular expression similar to:
  
    Regexp Pipes= regexp "[^|]+"
 10-May-2005 19:51
User is offline View Users Profile Print this message


Adam Gerber

Posts: 17
Joined: 8-Oct-2002

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
Report this to a Moderator Report this to a Moderator
 10-May-2005 20:32
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Answer Answer
You can do it with a regular expression similar to:
  
    Regexp Pipes= regexp "[^|]+"
Report this to a Moderator Report this to a Moderator
 10-May-2005 21:29
User is offline View Users Profile Print this message


Adam Gerber

Posts: 17
Joined: 8-Oct-2002

Thanks Ron,

I'm not going to tell you how stupid I feel! Got it to work.

Adam
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.