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