An extension of Regular Expression to find a string included between two characters, while EXCLUDING the delimiters
The solution to that question modified a tiny bit:
(?<=\#)(.*?)(?=\#)
Given a string "The #iPhone 4# is made by #apple#." that solution returns:
["iPhone 4", " is made by ", "apple"]
Now I'm not sure if this is possible using only a regex, but in this case " is made by " is not supposed to be returned. It simply happens to be squashed between the other two ## wrapped strings, and so is wrapped itself.
Clarification: The regex needs to support a variable number of #foo# strings in the parent string. There will not always be only 2.
Update
Due to the varied responses, and the realization that this problem is more simply solved without regex, I'm voting to close the question. Answer: do this without regex, in the language of your choice.