]+[\,\;]/")
: as you can see its pretty messy with a lot of repititions
First of all, that's not a regexp match, it's an equality. You wish
$i~/.../
... and yes, you may assign the longish R.E. above to a variable, and use:
$i~longre
: 2)Is line of code correct: $i="{orth}" $i "{\/orth}"
It is certainly syntactically correct, but I believe you wish
$i="{orth}" $i "{\\/orth}"
to properly insert a literal backslash inside the double-quoted string.
: I don't get any errors from nawk but when I try to use a2p (this is a function that converts awk to perl. I know awk but I need the power of Perl ie no limit to number of records) I get a syntax error and since my code isn't working properly anyway I'm assuming that tthe translator is better at catching errors.
I have _never_ been able to just use a2p without needing to do some minor
manual readjustments to the created code. (But then again I've always been
a hard-luck programmer. :-)
: 3)Is there an easy way to translate lex to awk?
Since lex implements an extended form of R.E.s incorporating R.E.
inclusion with {..}s, read-ahead ("/"), and the notion of "states",
there is no other solution than to hand-code it. To my knowledge, there
is no software tool to do this automagically.
: 4)Are there EUCs I should watch out for? ie in my above code with all the octal ranges could there be a character with a special meaning in awk?
When specifying an octal range, which is an _undocumented_ feature
appearing in _some_ versions of n/awk, one is then never typing a character
having a special meaning to a regular expression, so what is your question?
The only unresolved mystery yet to be solved in my n/awk programming
experience is to know why the equals sign ("=") in regexps has to be
escaped in SunOS versions of n/awk. This is entirely undocumented
behavior!
: Thanks a lot.
Hoaky doaky.
: ---Alex
-Brian
--
,---. ,---. ,---. ,---. ,---. ,---. ,---.
/ _ \ / _ \ / _ \ / _ \ / _ \ / _ \ / _ \
__,' `.___,' `.___,' `.___,' `.___,' `.___,' `.___,' `.__