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: Searching Text
Topic Summary:
Created On: 9-Aug-2004 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.
 9-Aug-2004 17:41
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I've written my own string sub-string search function. It looks for the sub-string in each position of the string, starting from 0. Its probably inefficient but it works OK. When I write DXL for other folks, however, I don't want to send my Library.

Using the "contains" buffer command doesn't work since the sub-string isn't preceeded by a non-alpha-numeric character. The "findRichText" command should work unless the string itself is actual RichText. If the string IS real Rich-Text then that function only finds the raw-text portions.

I was wondering how other people do sub-string searches. RegExpr seems like a way to go, but I don't know about that.

-Louie
Report this to a Moderator Report this to a Moderator
 10-Aug-2004 10:15
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

I'd definitely find a solution based on regular expressions -- but you knew I'd say that...

Paul.

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


Paul dot Tiplady at TRW dot com
TRW Automotive
Report this to a Moderator Report this to a Moderator
 11-Aug-2004 15:42
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

On further investigation it looks like the "matches" command looks promising. Attached is a snippette. If you always must match case, then the user doesn't need the function and can simpy issue "if (matches(MatchString, InString))" and doesn't need the function.

Test is shown for RichText. Notice that "LAL" isn't found because the function correctly looks for actual characters in the string, not taking notice of the RichText markup. The function "findRichText" WILL find "LAL" since this text spans the RichText markup (visible text in the object).

- Louie
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.