The following code :
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - RegularExpression example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
; Will match every word of 3 letters, lowercase with a 'b' as middle letter
;
If CreateRegularExpression(0, Chr(34)+".*"+ Chr(34))
Dim Result$(0)
NbResults = ExtractRegularExpression(0, Chr(34)+"alain"+Chr(34)+" "+Chr(34)+"allo"+Chr(34), result$())
Debug "Nb matchs found: " + NbResults
For i = 0 To NbResults - 1
Debug Result$(i)
Next
Else
MessageRequester("Error", RegularExpressionError())
EndIf
The result I'm looking for is :Nb matchs found: 1
"alain" "allo"
Thank you in advance for your help.Nb matchs found: 2
"alain"
"allo"