AW: matching a part of expression
Michael Rachow <[email protected]> Fri, 6 Jun 2003 15:50:01 +0200
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <91B7F87B3B5ED4119D270080AD417DA23260B8@MAIL> |
Hi Jerzy,
I don't think that you can express this using one regular expression.
I see two tactics.
A)
You create an array with an one character regular expression
for every input position.
You would than check the just entered character against the corresponding
array
index (maybe it's not at the end of input string).
B)
You have a regular expression for every length of the input string
\d{1}
\d{2}
\d{2}-
\d{2}-\d{1}
aso
Maybe you have pretty ideas in building it up.
Regards
Michael
-----Ursprüngliche Nachricht-----
Von: Jerzy Kut [mailto:[email protected]]
Gesendet: Freitag, 6. Juni 2003 14:54
An: [email protected]
Betreff: matching a part of expression
Hello oro-users,
I want to test what part of pattern matches to input character stream.
My goal is to avoid entering of bad characters on caret during typing in
textfield
and matching whole expression on textfiled focus exit.
I would to have one pattern for all matching (applyed by user).
E.g.
pattern: [0-9]{3}
input: 0
should passed partially matching but not passed full matching
but
input: 000
should passed both tests.
Is this possible? Or is any method to do it?
Please don't say me that I can do it by apply pattern like:
[0-9]{0,3}
:-)
--
Best regards,
Jerzy mailto:[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]