Re: RegEx: How to ignore the number of whitespaces?
- From: "Kevin Spencer" <unclechutney@xxxxxxxxxxxx>
- Date: Wed, 20 Jun 2007 07:14:45 -0400
That is helpful, but I still have a few questions.
"Users of my programme input sequences of arbitrary Unicode characters<snip>
(from now on, referred to as "patterns"). These patterns are supposed
to match other given sequences of Unicode characters (from now on,
referred to as "strings").
I'm looking for the easiest way to quickly convert the pattern into a
standard regular expression.
This sounds like the "patterns" are performing the work of regular
expressions, matching character sequences in strings. What I don't
understand is why you want to create a new regular expression syntax which
your users must learn, then convert it to the original, rather than using
the original? Or perhaps I'm misunderstanding your intention altogether?
Second, what are the limitations of the "arbitrary Unicode characters?"
There are over 16 million Unicode characters, and if we confine ourselves to
a single character set, we are still talking about alphanumeric characters,
punctuation, diacritical characters, and non-printing characters. I will
assume that some of these are not within the set of "arbitrary" characters
you're referencing. But I don't know which ones are allowed, and which ones
are not.
Certain subsequences of a pattern may be marked as optional. These may
be found in the string, but need not.
Certain subsequences of a pattern may be marked as a set of
alternatives. Exactly one of them must be found in the string, neither
more nor less.
Okay, we've discussed "arbitrary," but now you will need to define the term
"marked." As the "patterns" are pure text, the "marks" must also be text.
But what consitutes a "text" character and a "mark" character, and how do
you escape text characters to create marks?
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Florian Haag" <florianhaag@xxxxxxxx> wrote in message
news:Ofgo6JssHHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
Kevin Spencer wrote:
If you can explain the requirements of the pattern you're trying to
match, without using any regular expression terminology, I can help.
Hi,
thanks for your response!
Hope this is something like what you meant:
"Users of my programme input sequences of arbitrary Unicode characters
(from now on, referred to as "patterns"). These patterns are supposed
to match other given sequences of Unicode characters (from now on,
referred to as "strings").
Certain subsequences of a pattern may be marked as optional. These may
be found in the string, but need not.
Certain subsequences of a pattern may be marked as a set of
alternatives. Exactly one of them must be found in the string, neither
more nor less.
A pattern will never require more than one space character without any
other characters in between to be found in a string.
A pattern will accept any number of space characters (greater than
zero) without any other characters in between in the string at a
position where a space character is expected.
A pattern will ignore any space characters at the beginning and at the
end of a string.
A pattern will never require any space characters at the beginning and
at the end of a string."
I'm looking for the easiest way to quickly convert the pattern into a
standard regular expression.
Thanks in advance,
Florian
.
- Follow-Ups:
- Re: RegEx: How to ignore the number of whitespaces?
- From: Florian Haag
- Re: RegEx: How to ignore the number of whitespaces?
- References:
- RegEx: How to ignore the number of whitespaces?
- From: Florian Haag
- Re: RegEx: How to ignore the number of whitespaces?
- From: Chris Diver
- Re: RegEx: How to ignore the number of whitespaces?
- From: Florian Haag
- Re: RegEx: How to ignore the number of whitespaces?
- From: Kevin Spencer
- Re: RegEx: How to ignore the number of whitespaces?
- From: Florian Haag
- RegEx: How to ignore the number of whitespaces?
- Prev by Date: Re: Configuration utility missing
- Next by Date: Re: help on richtextbox
- Previous by thread: Re: RegEx: How to ignore the number of whitespaces?
- Next by thread: Re: RegEx: How to ignore the number of whitespaces?
- Index(es):
Relevant Pages
|