Re: Regular Expression
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Wed, 8 Nov 2006 15:25:06 -0500
"John Gordon" <gordon@xxxxxxxxx> wrote in message
news:eitahe$it7$1@xxxxxxxxxxxxxxxxxxxx
In <1163012269.707590.302280@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> "Rahul"
<ravi.sgn@xxxxxxxxx> writes:
I need a regular expression..
The conditions are as follows...
1. There should not be any blank spaces.
^[^ ]*$
(Note that I interpreted "spaces" literally. If you also wanted to
exclude
other space-like characters such as tabs, you'll have to modify this
expression.)
2. Text may or may not contain slashes.
I'm not sure why this condition is even listed. It's okay to have
slashes,
but it's also okay not to have them. This condition is meaningless.
It depends on whether you think the conditions are inclusive or
exclusive (or additive versus subtractive, or implicit versus explicit,
whichever pair of terms you prefer). I.e. are we allowing all strings, as
long as they don't break any of the above conditions? Or are we not allowing
any strings, unless these conditions allow them? If it's the latter, the RE
might be more like:
^/*$
But yeah, condition 2 is a red flag telling me that the problem is not
well understood, and further clarification would help.
- Oliver
.
- References:
- Regular Expression
- From: Rahul
- Re: Regular Expression
- From: John Gordon
- Regular Expression
- Prev by Date: Re: Commercial Java program bundled with 'free' database?
- Next by Date: Re: Fabonicseries Program required
- Previous by thread: Re: Regular Expression
- Next by thread: Re: Regular Expression
- Index(es):
Relevant Pages
|