Chris Andrews
asked on
Regular expression help please
Arrgh, I chose a solution on my last question a little to quickly, didn't test it completely (though the question was answered well)
I have this:
preg_match_all('/<start_sn ip>[^<]*<e nd_snip>/' ,$str,$mat ch);
I need it changed so that it delivers all the content in between the <start_snip> and <end_snip>, as it is above, it only delivers if numbers are in between, I need letters, numbers, commas, cash signs, periods, everything. I don't know/understand reqular expression enough to do this myself, out of my league!
I'm using php4.3.3 if that makes a difference here.
Thanks, Chris
I have this:
preg_match_all('/<start_sn
I need it changed so that it delivers all the content in between the <start_snip> and <end_snip>, as it is above, it only delivers if numbers are in between, I need letters, numbers, commas, cash signs, periods, everything. I don't know/understand reqular expression enough to do this myself, out of my league!
I'm using php4.3.3 if that makes a difference here.
Thanks, Chris
On your first question, you implied there might be several strings of start_snip, something, end_snip in each input. Is that true?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I believe you are correct, TeRReF.
ASKER
Thank you both!
That works, actually, both ways work without any errors.
Suggestions on how I should reward points on this? Since both work but JamesCssl indicates TeRReF's is (more?) correct?
That works, actually, both ways work without any errors.
Suggestions on how I should reward points on this? Since both work but JamesCssl indicates TeRReF's is (more?) correct?
I'm actually surprised it worked without the parenthesis. I would split up the points.