Re: Construction of a non-regexable subset of the set of all strings
- From: David Squire <David.Squire@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Jun 2006 15:31:09 +0100
Glenn Jackman wrote:
At 2006-06-23 08:45AM, Dominic van der Zypen <dominic.zypen@xxxxxxxxx> wrote:Hello,
I have a question which I am afraid might seem "overly scientific" (not
to say nutty), but which I find is quite natural after all.
If we look at the set S of all finite strings, then each regex
represents some subset of S. For instance, h(a|e)ndel is the set
consisting of handel and hendel; and the regex .+ represents the set
of all non-empty strings not containing \n.
I wondered whether there is a "non-regexable" subset N of S (i.e. a
subset N for which there is no regex representing N) and came up with
a (non-constructive) positive answer from set theory: there are
uncountably many subsets of S, but there are only countably many
regular expressions, so there are non-regexable subsets.
What I would like to know is whether one can construct a subset N of S
which is non-regexable (and whether it is hard to prove that N has the
desired property).
It seems to me that, for every string x in S, one can construct at least
one regular expression to match it, i.e. ^x$
Yes, but the set of all subsets of S is not the same as the set of single strings in S (i.e. S).
DS
.
- References:
- Construction of a non-regexable subset of the set of all strings
- From: Dominic van der Zypen
- Re: Construction of a non-regexable subset of the set of all strings
- From: Glenn Jackman
- Construction of a non-regexable subset of the set of all strings
- Prev by Date: Re: Using command line argument as variable name
- Next by Date: Re: question on printing to /dev/lp
- Previous by thread: Re: Construction of a non-regexable subset of the set of all strings
- Next by thread: Re: Construction of a non-regexable subset of the set of all strings
- Index(es):
Relevant Pages
|