New topic: 

regex search and replace

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

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       Bill Mounce           Post subject: regex search and 
replacePosted: Fri Oct 16, 2009 3:55 pm                        
Joined: Mon Oct 02, 2006 7:19 pm
Posts: 10              I have a pattern that I want removed from a string. I 
can see what to do to find what is removed (code below), but what I want is to 
end of up the text without the text removed by the regex search. I can probably 
do it manually, but I am sure regex can do it if I just knew the right command.

Thanks for your help.

Dim rg as New RegEx
Dim myMatch as RegExMatch
dim tStuff, tFixed as string

//tStuff is loaded with the full text to be searched
  
rg.SearchPattern = "<a .+?</a>"
myMatch=rg.Search(tStuff)
if myMatch <> Nil then
    tFixed = myMatch.SubExpressionString(0)
end if   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
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