In case i have a string
PHP Code:
new string[] = "str1-str2-str3-str4"
I am trying to get those data between'em '-'
I tried the following regex pattern , guess what no success
Second pattern i tried was also a fail.
Can someone write down how to make a regex pattern which will loop throughout the string and get all those data in between '-' ,
Note - my string can contain any amount of '-' , i already did it using strtok , but now i want it to be done in regex.
I had try using 's' flag , no success . All i get is "str1" as the output