Re: Need two simple string funcs for parsing

From: Date: Fri, 09 Jul 2004 06:56:37 +0000
Subject: Re: Need two simple string funcs for parsing
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-11016@lists.php.net to get a copy of this message
Hello jtl, Friday, July 9, 2004, 1:07:49 AM, you wrote: > Hello, > My name is Joe Lapp, and I have written high-speed portal-side parsers in > Java for XML, HTML, and various other XML-related syntaxes (e.g. XQL). > I am planning a series of new parsing technologies that I'd like to > implement in PHP. To allow my parsers to perform with high efficiency in > PHP, I need two new string functions. One is identical to strpbrk() but > would also take a starting-offset parameter. > Here are the two new functions: > /* strpbrk -- Returns the offset into a string of the first occurrence of > any character found in a list of provided characters, optionally scanning > the string starting from a provided string offset. */ > strpbrk(string haystack, string char_list [, int starting_offset]) > /* strnpbrk -- Returns the offset into a string of the first occurrence of a > character NOT found in a list of provided characters, optionally scanning > the string starting from a provided string offset. */ > strnpbrk(string haystack, string char_list [, int starting_offset]) > In other words, strpbrk() would function as it does currently, but it would > take a starting_offset. strnpbrk() would be almost identical to this new > strpbrk(), except that it skips over characters found in the provided > character list and returns the position of the first character that is not > in the list. See here: http://php.net/strspn http://php.net/strcspn And the names are colliding with http://php.net/strpbrk please read the docs. -- Best regards, Marcus mailto:helly@php.net

« previous php.internals (#11016) next »