PHP Find String and Following Unknown Characters

Zippo007

New Member
I'm still learning PHP Regex so I'm hoping someone can help me with what I'm trying to accomplish.\[code\]$string = 'Writing to tell you that var MyCode = "dentline"; Learn it.';\[/code\]What I'd like to do is match the part of the string which reads\[code\]var MyCode ="\[/code\]After I match that part, I want to retrieve the rest of the dynamically generated characters that follow that string. In this example, [dentline] is 8 characters, but this may not always be the case. Therefore, I want to match all the way until I reach\[code\]";\[/code\]After I've effectively captured that part of the string, I want to strip the string so the remaining information is what lies between the double quotes\[code\]dentline\[/code\]Any help is much appreciated!
 
Back
Top