I’m writing a parser and I need to extract words that are between double pipes using php
For example I want to extract the ‘ipsum’ from the string below
Lorem ||ipsum|| blah
If there are multiple words between double pipes, they should be extracted as well
Clarification
When I say multiple words I don’t mean this: ||word another word||
I mean this
||Word1|| blah blah (newline)
blah ||Word2||
Clarification part 2
the ||quick|| brown fox ||jumps|| over the lazy ||dog||
What should be extracted should be the words ‘quick’, ‘jumps’ and ‘dog’
Sorry for the confusion… There probably are some right answers below, I’ll pick one once I confirm it tomorrow at work 🙂
Try this:
Or if there are multiple
||, try this: