Code: Select all
Function ReFind(FindIn, FindWhat As String, Optional IgnoreCase As Boolean = False)
    Dim i As Long
    Dim matchCount As Integer
    Dim RE As Object, allMatches As Object, aMatch As Object
    Set RE = CreateObject("vbscript.regexp")
    RE.Pattern = FindWhat
    RE.IgnoreCase = IgnoreCase
    RE.Global = True
    Set allMatches = RE.Execute(FindIn)
    matchCount = allMatches.Count
    If matchCount >= 1 Then
        ReDim rslt(0 To allMatches.Count - 1)
        For i = 0 To allMatches.Count - 1
            rslt(i) = allMatches(i).Value
        Next i
        ReFind = rslt
    Else
        ReFind = ""
    End If
End Function
In OO Basic I didn't find any information concerning regexp find/replace function, there is only one mention about global find/replace method, accessible via menu.
What is the simplest way to get regexp substring from some cell in OOCalc?
 
						 
  It works fine for this fixed example.
 It works fine for this fixed example.
