I have the following text example:
MyRelationsPDF001-Cover-Disclaimer-22012017
I want to capture with php regular expressions the texts
"Cover", "Disclaimer" and "22012017".
I'm trying to use the preg_match_all()
function as follows:
preg_match_all("MeusRelatoriosPDF001-(\w*)-(\w*)-(\w*)",$links,$array);
Where in the parameter $links
comes texts separated by the indicated strokes. It is also worth mentioning that the 3 parameters in the variable do not always come. Ex: The variable $link
could come only
"MyRelationsPDF001-Cover-Disclaimer" or "MyRelationsPDF001-Cover"
The error that is popping up is
"Warning: preg_match_all (): Delimiter must not be alphanumeric or backslash".
Can anyone help me how could I capture these texts and put each variable in a $array
position?