I have a problem when using the magic char "?".
when I do this = "c(1?)", it can find c or c1.
but if I do this = "c(%b?)", then it wont work :(
QuoteOriginally posted by Mutor
%b<> matches anything between the < >, they can be replaced by anything you want
that wasn't what I meant :baby:
what I meant is that it seems like when you use pattern objects like %a and %b etc, "?" won't work :(
and what I mean by not working is that with "c(%b?)", it can find c1, c2, c3 etc. But it cant just find "c".
Isnt it '%d?' to catch one digit or none digit?
QuoteOriginally posted by VidFamne
Isnt it '%d?' to catch one digit or none digit?
ya, ? = 0 or 1 repitions
QuoteOriginally posted by Mutor
Quotewhat I meant is that it seems like when you use pattern objects like %a and %b etc, "?" won't wor
Well, it wont work with %b, because by itself its not a valid pattern. We normally use %b in Ptokax for username in pattern, which is in <> so, we do %b<>.
You need to supply the next two charachters for %b, could be %b[], or %b{}, or %baz.
ok,whoops, I typed the wrong letter when I posted in the forum, I meant %d.
Anyway, it isn't just %d it doesn't work with, its all of them =
%a,%c,%d,%l,%p,%s,%u,%w,%x,%z
QuoteOriginally posted by Mutor
Quoteand what I mean by not working is that with "c(%b?)", it can find c1, c2, c3 etc. But it cant just find "c".
Why should 'c' match the pattern? You'll only match what's in parenthesis, if 'c' precedes it.
ehm, no, actually not ;) if you use c(1?), it can find c and c1 ;) and if you just have c(%d), it can find for example c1 c2 c3 c4 etc ;)
QuoteOriginally posted by Mutor
QuoteBut it cant just find "c".
Quoteehm, no, actually not if you use c(1?), it can find c and c1 and if you just have c(%d), it can find for example c1 c2 c3 c4 etc
'c' may start the pattern, yet its not part of the capture [if capturing]. You should only use '?' there if '1' [or %d ] is not a required capture.
it
can find just "c" if its "c(1?)", but not if its "c(%d?)".