|
Posted by Leif Gregory on 03/04/05 22:12
Hello Shaun,
Friday, March 4, 2005, 12:54:34 PM, you wrote:
S> Please could someone tell me how i can extract the information from
S> a string that is after 'ID_' and before '_FN'
<?php
$myString = "ID_723456ABc_FN";
preg_match("/ID_([a-z0-9]+)_FN/i",$myString, $extracted);
echo $extracted[1];
?>
This will match any upper or lowercase letter and number. If you have
other characters like _ , etc, then you'll need to put those in
the [a-z0-9_,] too.
--
Leif (TB lists moderator and fellow end user).
Using The Bat! 3.0.2.3 Rush under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB
[Back to original message]
|