parse a name

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

well it turns out feyd was correct....string was formated like so:

Player Statistics for Delta Force - Black Hawk Down










Ozymandias.
Rank: 1-Star General ( 14 )

so this did the trick:

Code: Select all

preg_match('#Down\s+(.*?)\s+Rank#', $strip, $matches);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Image
Post Reply