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: string function
Topic Summary: need to replace string
Created On: 6-Sep-2007 17:41
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 Peter Albert, on Friday, September 7, 2007 2:55 PM

Answer:
Paul is right. But in addition, the regexp so far only extracts the complete string within the brackets, not the jump/fence part. You can get it with a second regexp searching for the closing bracket (see attached code),


Peter
 6-Sep-2007 17:41
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

{\lazy\fox jumps}{\lazy\fox fence}


I am trying to extract "jumps" then "fence"

i was trying regexp "\{\\lazy\\fox (.*)\}"
but it does not work

any help appreciated..

Regards
Tarun
Report this to a Moderator Report this to a Moderator
 7-Sep-2007 08:35
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

Because the Regexp is being parsed twice (once to create the regexp and once to check the string against it) you need to escape the escape chars:

regexp "\\{\\\\lazy\\\\fox (.*)\\}"

... I think. Not sure about the \\{ and \\} ...

Paul.

-------------------------


Paul dot Tiplady at TRW dot com
TRW Automotive
Report this to a Moderator Report this to a Moderator
 7-Sep-2007 09:08
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Answer Answer
Paul is right. But in addition, the regexp so far only extracts the complete string within the brackets, not the jump/fence part. You can get it with a second regexp searching for the closing bracket (see attached code),


Peter

Edited: 7-Sep-2007 at 09:09 by Peter Albert
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.