On Jan 30, 2007, at 9:55 PM, Carlos M wrote:
On Jan 29, 2007 8:59 PM, Guyren Howe wrote:
<http://realsoftware.com/feedback/viewreport.php?reportid=udsbvegd>
In 2K7r1, the first regex match against a string updates the
SearchStartPosition, but subsequent searches only ever find the first
match, and SearchStartPosition isn't updated.
This is *not* correct.
The problem is that you're not using RegEx.Search correctly ;-)
In this example, that you posted with the report,
Dim r As New RegEx
Dim m As RegExMatch
Dim searchString As String = "abcdabce"
r.SearchPattern = "abc(d|e)"
m = r.Search(searchString)
Break //Here, r.SearchStartPosition = 4, as it should be
m = r.Search(searchString)
Break //Here, r.SearchStartPosition = 4, and we still find the
first pattern
the second time you use Search you cannot use the "searchString"
for the
TargetString parameter and you should only use:
m = r.Search() // without the TargetString
and then you'll get 8 for the r.SearchStartPosition.
I guess I should read the docs more closely. Thanks.
_______________________________________________
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>