New topic: 

RegExOptions Question ?

<http://forums.realsoftware.com/viewtopic.php?t=30544>

       Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic         Author  
Message       Dralion           Post subject: RegExOptions Question ?Posted: 
Sun Oct 18, 2009 8:30 pm                        
Joined: Sat Mar 15, 2008 8:14 am
Posts: 116
Location: Montreal, Quebec, Canada              I everybody
I try to understand and use theCode:rg.options.StringBeginIsLineBegin=trueI try 
to use it to search exact string in the begening of my listbox Cell... like 
(chene) But wont work... the result show up even string in the middle of 
another word (Deschene).
The other option i use work fine like Code:rg.options.CaseSensitive=True But 
neither stringbegin and stringend wont work
This is my search button event
  Code:Dim rg as New RegEx
Dim zx as integer
Dim z as Integer

rg.SearchPattern=efdb1.Text

z = lbcompare.ListCount
zx = z -1

for zz as integer = 1 to zx
  
  rg.options.CaseSensitive=True
  rg.options.StringEndIsLineEnd=True
  rg.options.StringBeginIsLineBegin=true
  
  myMatch=rg.search(lbcompare.Cell(zz,0))
  
  if myMatch <> Nil then
  
  StaticText1.text=myMatch.SubExpressionString(0)
  
  MsgBox("OK trouver")
  
  else
  StaticText1.text="Text not found!"
  End if
next

Any idea

Thanks     
_________________
--------------------
RB 2009r3 on winXP Sp2  
                            Top                Den           Post subject: Re: 
RegExOptions Question ?Posted: Sun Oct 18, 2009 9:39 pm                        
Joined: Mon Jul 03, 2006 3:44 pm
Posts: 209
Location: South France              You'll need to do something like this if 
you want to match only whole words:
Code:rg.SearchPattern= "\b" + efdb1.Text + "\b"
I guess rg.options.StringBeginIsLineBegin deals with multiline text and the way 
line endings are processed.     
_________________
Den  
                            Top               npalardy           Post subject: 
Re: RegExOptions Question ?Posted: Sun Oct 18, 2009 10:23 pm                    
    
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 5341
Location: Canada, Alberta, Near Red Deer              if you're looking for 
something at the beginning of the text and it has to be precise a simple usage 
of the Left() function would be sufficient     
_________________
My web site Great White Software
RBLibrary.com REALbasic learning  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to