Hi Christian,

is there a difference between Real's Regex syntax and yours?

In some instances RegexMBS doesn't find the search string where my old code 
does.

Old code:

  Dim out(-1) As String
  Dim re As New RegEx
  Dim rm As RegExMatch
  Dim startPos As Integer
  
  re.SearchPattern = delimPattern
  rm = re.Search( source )
  while rm <> nil
    out.Append MidB( source, startPos + 1, rm.SubExpressionStartB(0) - startPos 
)
    startPos = re.SearchStartPosition
    rm = re.Search
  wend
  
  if startPos < source.LenB then
    out.Append MidB( source, startPos + 1 )
  end if
  
  return out

New code:

  Dim out(-1) As String
  
  Dim re As New RegExMBS
  
  if re.Compile(delimPattern) then
    
    dim start as integer = 0
    while re.Execute(source, start)>0 and start < lenb(source)
      
      dim p as integer = re.Offset(0)
      dim temp as string = midb(source, start + 1, p - start)
      out.Append mid(source, start + 1, p - start)
      start = re.Offset(1)
    wend
    
  else
    MsgBox "failed to compile"
  end if
  
  return out

Delimpattern "=_3690988c88db6b38ecc6fc4f41165aaf"

Searchtext: 

--=_3690988c88db6b38ecc6fc4f41165aaf
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

End of Searchtext

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to