Murray @ PlanetThoughtful wrote:
> Changing the "*" to a "+" (at least one or more occurrences) could 'fix'
> that pattern (ie so that it doesn't match your string), depending on any
> other values being tested by it.
*keyboardbiting* I see... thanks to all of you who helped so fast.
Jens
--
P
Murray: I could kick myself for not seeing that one (* = 0 or more,
well it sure found 0)
On 9/26/05, Murray @ PlanetThoughtful <[EMAIL PROTECTED]> wrote:
> > I recently encountered a strange behaviour, could someone please
> > countercheck it, to either tell me there is an error in my pattern?
>
> I recently encountered a strange behaviour, could someone please
> countercheck it, to either tell me there is an error in my pattern?
>
> I have a test string: "7005-N/52"
> I have two match patterns:a) "/([0-9]*)\/(.*)/i"
> b) "/([0-9]*)\-(.*)/i"
> I check the
Jake was fast ;-) and he is on the right track too
(although I don't think that the substrings he guessed are
the exact ones that are found).
you might want to check preg_match_all to see the matches
that PCRE comes up with for each regexp...
also take a look at:
$test = "7005-N/52";
var_dump(
When using "/([0-9]*)(.*)/i" it matches
substring 1: 7005
substring 2: -N/52
When using "/([0-9]*)\/(.*)/i" it matches
substring 1:
substring 2: 52
It looks to me as though its trying to match either or subgroup in order.
On 9/26/05, Jens Schulze <[EMAIL PROTECTED]> wrote:
> I recently encounter
5 matches
Mail list logo