regex - i want to build regular expression to extract substring from string in php
243
I have a string like this:"date created:12 march 1996phone:33444567Location:california steet 5"
date created
,phone
andlocation
are fixed but their value is changing. I want to extract them from string and want to display them separate.
Answer
Solution:
You can use
to split the string at the keywords:
Answer
Solution:
This should do it...
Output
This uses named capturing groups so you can access the data with...
See it on ideone.com
Answer
Solution: