![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Searching Text Topic Summary: Created On: 9-Aug-2004 17:41 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Searching Text
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.