August 29th, 2008, 12:08 PM
Looking for RegEx pattern to retrieve data inside <b> tags
The following RegEx expressions retrieves <B>HI</B> and <B>CA</B>, but I'm only interested in retrieving the data inside the tags (HI and CA), WITHOUT KNOWING WHAT IS INSIDE THE TAGS.
RegEx That I'm currently using:
The offer is not available to customers living in <B>HI</B> and <B>HI</B>
Last edited by cd_gary; August 29th, 2008 at 12:43 PM.
August 29th, 2008, 03:10 PM
$yourString = " The offer is not available to customers living in <B>HI</B> and <B>CA</B> ";
preg_match_all("#<b[^>]*>(.+)</b>#iU", $yourString, $foo);
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.