Re: [PHP-DEV] preg_match() option for anchored offset?

2017-06-08 Thread Rasmus Schultz
> You are looking for the \G anchor or the A modifier. Both of these options work great! I've submitted a patch to the manual page with a note explaining these options. Thanks :-) On Wed, Jun 7, 2017 at 10:13 PM, Nikita Popov wrote: > On Wed, Jun 7, 2017 at 10:03 PM,

Re: [PHP-DEV] preg_match() option for anchored offset?

2017-06-07 Thread Nikita Popov
On Wed, Jun 7, 2017 at 10:03 PM, Rasmus Schultz wrote: > What do you think about adding another option to preg_match() to allow the > $offset parameter to be treated as the start anchor? > > The manual proposes to do this: > > $subject = "abcdef"; > $pattern =

Re: [PHP-DEV] preg_match() option for anchored offset?

2017-06-07 Thread Rowan Collins
On 07/06/2017 21:03, Rasmus Schultz wrote: What do you think about adding another option to preg_match() to allow the $offset parameter to be treated as the start anchor? The manual proposes to do this: $subject = "abcdef"; $pattern = '/^def/'; $offset = 3;

[PHP-DEV] preg_match() option for anchored offset?

2017-06-07 Thread Rasmus Schultz
What do you think about adding another option to preg_match() to allow the $offset parameter to be treated as the start anchor? The manual proposes to do this: $subject = "abcdef"; $pattern = '/^def/'; $offset = 3; preg_match($pattern, substr($subject, $offset), $matches); In