![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Regular Expression Topic Summary: Created On: 17-Apr-2007 12:36 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi all,
I do not have much experience with regular expressions but I thought they might help solve my problem. What I want to do: I have a string which contains usernames or email addresses separated by blanks. I would like to put those into a skip list to use the sendEmailMessage function. The following regular expression correctly returns the first match in the string Regexp regulex = regexp "[a-zA-Z|0-9|.][^ ]*" Maybe I am doing it all wrong. or maybe regular expression is not the best way to do it at all... Any help or suggestion will be much appreciated. Thank you Karl |
|
![]() |
|
![]() |
|
The simplest solution that I know of is to lop the front off the string after you've processed it. So you need to swap the 'if' for a 'while', and add something like 'txt = txt[end 0:]' at the end of the while loop.
See code snippet (modified). ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
|
![]() |
|
Hi Karl,
your regular expression is not much suited for finding the explained strings. It would be much better do this in following way: Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Hi Reik,
your code works just great! Thanks a lot. Paul, your code as it is creates an endless loop. But thank you anyway. cheers Karl |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Regular Expression
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.