[Biophp-dev] Bioinformatics mentioned (briefly) in Zend Weekly news

S Clark biophp-dev@bioinformatics.org
Tue, 15 Jul 2003 12:41:14 -0600


http://www.zend.com/zend/week/week143.php

"Andrei Zmievski has had some requests from people working in bioinformatic=
s=20
to slightly modify the preg_match_* functions slightly.

 The idea would be to allow a starting offset within the string to be=20
specified.

 At this stage, it is unknown whether or not the changes will be made in a=
=20
transparent way to the existing code or if a new extension will be created."

To me, this means one important thing - we're not the only ones
considering bioinformatics with PHP...

=46rom my perspective, having an 'offset' in the official preg_match(_whate=
ver)
functions is really just a convenient shortcut.  Meanwhile, there's always:

function preg_match_offset($pattern,$subject,$matches=3D"",$offset=3D0,$fla=
gs=3D"")
{
	$newsubject=3Dsubstr($subject,$offset);
	if (is_Array($matches)) {
		if( is_int($flags)) {
			return (preg_match($pattern,$newsubject,$matches,$flags));
		} else {
			return (preg_match($pattern,$newsubject,$matches));
		}
	} else {
		if (is_int($flags)) {
			return (preg_match($pattern,$newsubject,,$flags));
		} else {
			return (preg_match($pattern,$newsubject));
		}
	} else {
		return false; //shouldn't get here
	}
}

(Just whipped that off the top of my head, so apologies for any stupid
mistakes...)