[php] preg_match dzialajacy jak strpos

0

Witam

Chciałbym sie dowiedzieć czy istnieje możliwość przeszukania tekstu wyrażeniem regularnym, a w wyniku dostać nie wyrażenie, a numer znaku w stringu, od ktorego zaczyna sie szukany tekst. Czyli taki strpos tylko z regexpem?

0
manual napisał(a)

int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] )
[...]
flags

flags can be the following flag:

PREG_OFFSET_CAPTURE
    If this flag is passed, for every occurring match the appendant string offset will also be returned. Note that this changes the value of matches into an array where every element is an array consisting of the matched string at offset 0 and its string offset into subject at offset 1.

1 użytkowników online, w tym zalogowanych: 0, gości: 1