Re: regular expression for perl, tcl, sed, grep, awk
From: Martien Verbruggen (mgjv_at_tradingpost.com.au)
Date: 12/09/03
- Next message: William: "Can't resample with Lame"
- Previous message: Iain Chalmers: "Re: Am I right on Mod_Perl?"
- In reply to: Jay eL: "regular expression for perl, tcl, sed, grep, awk"
- Next in thread: Jay eL: "Re: regular expression for perl, tcl, sed, grep, awk"
- Reply: Jay eL: "Re: regular expression for perl, tcl, sed, grep, awk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 09 Dec 2003 02:59:48 GMT
On 8 Dec 2003 17:59:53 -0800,
Jay eL <xiaohwarang@yahoo.co.uk> wrote:
> Hi all,
>
> I wonder is the regular expression the same for perl, tcl, sed, grep
> and awk except for the syntax?
It's a bit of an odd question. What do you mean "the same" "except for
the syntax"? The syntax is different in many cases, and the features
are also different for many of them. It also depends on your platform
which sorts of RE are supported by your sed, grep and awk. There are
minimal sets defined by standards, but that doesn't mean that your
local ones don't support more.
Generally: unless the software specifically mentions that it supports
Perl's RE, it won't. Perl's RE engine is pretty much the most powerful
out there (pcre is a library making Perl RE available to other
programs).
Some tools support more than one RE syntax, depending on invocation
and arguments.
I don't know which RE tcl supports nowadays. I haven't touched it in
about 8 years.
> all the usage for . * ? + / () [] are
> the same?
The slash is not a special character in regular expressions, but it's
most often used as the delimiter for the operators that take regular
expressions in tools that do.
The others should all pretty much act the same, although in some RE
engines you actually need to escape some of them to make them special.
You'll have to read the documentation of the tool or language you're
interested in to find out more.
Why did you ask this question in a Perl group? Or did you post it
independently to a bunch of other groups as well?
Martien
--
|
Martien Verbruggen | You can't have everything, where would you
Trading Post Australia | put it?
|
- Next message: William: "Can't resample with Lame"
- Previous message: Iain Chalmers: "Re: Am I right on Mod_Perl?"
- In reply to: Jay eL: "regular expression for perl, tcl, sed, grep, awk"
- Next in thread: Jay eL: "Re: regular expression for perl, tcl, sed, grep, awk"
- Reply: Jay eL: "Re: regular expression for perl, tcl, sed, grep, awk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|