Posted to microsoft.public.excel.programming
|
|
Help with a Regex Pattern
I though the ? represent any one character. I would think these would be
better
([JjXxZz][ ]\s)\d{3}\s[ =][A-Za-z]
"Ron Rosenfeld" wrote:
Joel,
As I understood the OP's request, both the initial letter and the subsequent
space are optional.
The "?" indicates that everything in the preceding is optional, since the
preceding is enclosed in parentheses.
So either
J 123 K
or
123 K
would be acceptable.
--ron
On Sun, 29 Apr 2007 07:48:01 -0700, Joel
wrote:
Ron: Shouldn't the '?' be optional? this would be the space after the first
optional character.
"Ron Rosenfeld" wrote:
On 29 Apr 2007 06:55:01 -0700, wrote:
I have data which is in this format:
J 123 K
The J is optional, could be upper or lower case, and could be a J or
an X or a Z.
It is always followed by a space. The three digits. Then a space.
Then any alphabetic character upper or lower case, but not optional,
the character must be there.
([JjXxZz]\s)?\d{3}\s[A-Za-z]
I am having trouble with the pattern, could someone show me how to set
it up?
tia
bob
--ron
--ron
|