I have strings, for example:
bool dxDrawImage float posX, float posY, float width, float height, mixed image , float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = white, bool postGUI = false
bool dxUpdateScreenSource element screenSource, bool resampleNow =false
I need get parts from it, for example:
bool dxDrawImage
float posX
float posY
...
I wrote:
preg_match_all("/(bool|float|int)[a-zA-Z0-9\s=]+/", $txt, $ar);
print_r($ar):
Array ( [0] => Array ( [0] => bool dxDrawImage float posX [1] => float posY [2] => float width [3] => float height [4] => float rotation = 0 [5] => float rotationCenterOffsetX = 0 [6] => float rotationCenterOffsetY = 0 [7] => int color = white [8] => bool postGUI = false ) [1] => Array ( [0] => bool [1] => float [2] => float [3] => float [4] => float [5] => float [6] => float [7] => int [8] => bool ) )
Why this regexp capture bool dxDrawImage float posX
instead
bool dxDrawImage
float posX
How to fix this?