Jump to content

[SOLVED] PREG_match help


briant

Recommended Posts

These regular expressions are so hard to understand. Anyone know of a really good tutorial?

 

My problem is this.

 

$content = "<h2>hi</h2> 123 (cats)<br> 456 (dogs)<br> 789 (fishes)";

 

I want to be able to match 456 because of dogs. Usually I can do it if the pattern is before but since this is after, how can I do it?

 

PS: This is for content I have no control over, so I can't change the content.

Link to comment
https://forums.phpfreaks.com/topic/160891-solved-preg_match-help/
Share on other sites

Oh sorry, I should have looked through the other forums.

 

Thank you for your help. I will try that out and let you know.

 

I will try to read the tutorial as well.

 

If it doesn't work out, I think I will just do a strstr function to get what I want.

 

Thanks for your assistance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.