From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Park Lee <parklee_sel@yahoo.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: Regular Expression Problem
Date: Sat, 12 Jun 2004 08:09:48 +0000 [thread overview]
Message-ID: <20040612080948.GP2861@lkcl.net> (raw)
In-Reply-To: <20040612063426.65218.qmail@web51509.mail.yahoo.com>
On Fri, Jun 11, 2004 at 11:34:26PM -0700, Park Lee wrote:
> Hi,
>
> In the file_contexts file, I found some regular expressions. I studied them for a while, but still can't understand them well.
>
> For example: /var(/.*)
>
> As I know: '.' stands for any character;
> Let's suppose '.' now stands for character 'a'.
> then '/var(/.*)' can mean:
> '/var/a','/var/aa','/var/aaa','/var/aaaa','/var/aaaaa', ... ...
>
> But now, If I have a file or directory named 'abc' in directory '/var' (i.e.,
> /var/abc). How can it match '/var(/.*)' ?
well, i don't pretend to understand regular expressions either:
they are one of the most obscure nasty amazingly compact hang-overs
from the days when computers didn't have enough space to store
wordey programs or programming languages.
i think you'll find that the regular expression you are referring to
is "/var(/.*)?" note the question mark which means it's optional.
dot means any one character, and star means zero or more characters.
so dot star means "one or more characters".
obtuse as it is, can i recommend that you read up on several
sources of regular expressions, for example "man regex"
and also
http://www.google.com/search?q=regular+expressions
remember we said google is your friend? well we REALLY MEANT IT!
if you don't know about something, put some random words into
google, first.
THEN if you can't find an answer, and it's definitely SE/Linux
related, ask.
sincerely,
l.
--
--
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility for acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<a href="http://lkcl.net"> lkcl.net </a> <br />
<a href="mailto:lkcl@lkcl.net"> lkcl@lkcl.net </a> <br />
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2004-06-12 8:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-12 6:34 Regular Expression Problem Park Lee
2004-06-12 8:09 ` Luke Kenneth Casson Leighton [this message]
2004-06-12 8:38 ` Russell Coker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040612080948.GP2861@lkcl.net \
--to=lkcl@lkcl.net \
--cc=parklee_sel@yahoo.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.