On Jun 10, 2006, at 6:18 PM, Mark Nutter wrote:
There's also the \b operator, which matches a word boundary.
\b([a-zA-Z'-]+)\b
will match any whole word (including words like "it's" and
"mish-mash"), without the need to keep track of \1 and \3 in the
substitution.
Note that \b is a rare sort of RegEx operator, in that it has a
different meaning when used inside square brackets: "\band\b"
matches the word "and" but not "band" or "handy", whereas
"[A-Za-z\b]" matches any alphabetic character plus Backspace.
Mark Nutter
Quick and easy regex creation and debugging!
http://www.bucktailsoftware.com/products/regexplorer/
I should check it out ... much to play with ..
Now I have this problem, I have a replaceAll function, but it do NOT
replace the first match ..
There is NO wholeword or casesesitive .....
dim rg as RegEx
dim SearchResult As RegExMatch
rg = New RegEx
rg.SearchPattern = EditField2.text
rg.ReplacementPattern = EditField3.Text
rg.Options.ReplaceAllMatches = true // If this is set to FALSE
only the second Match is replaced
SearchResult = rg.Search(EditField1.text)
if SearchResult <> nil then
EditField1.Text = ""
EditField1.AppendText rg.Replace
end if
Any ideas why NOT ALL matches is replaced ?
I have an example ready to post ....
Sven E Olsson
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>