Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

metachar in awk 3.1.3 under cygwin
Hello,

Please I'm trying to enter [ square left bracket in a regular expression
with awk 3.1.3 under cygwin. I use \[ but the system says :

warning: escape sequence '\[' treated as plain '['

how can I enter '[' in regular expression.

Thank you.
gdridi@club-internet.fr
http://perso.club-internet.fr/cdridi



Report this thread to moderator Post Follow-up to this message
Old Post
Gilles DRIDI
09-16-04 03:51 PM


Re: metachar in awk 3.1.3 under cygwin
In article <41434bf2$0$308$7a628cd7@news.club-internet.fr>,
Gilles DRIDI <gdridi@club-internet.fr> wrote:
>Hello,
>
>Please I'm trying to enter [ square left bracket in a regular expression
>with awk 3.1.3 under cygwin. I use \[ but the system says :
>
>warning: escape sequence '\[' treated as plain '['
>
>how can I enter '[' in regular expression.

Hmmmm.

% gawk '/\[/'
foo[bar
foo[bar
foo
% gawk '/[/'
gawk: cmd. line:1: /[/
gawk: cmd. line:1:  ^ unterminated regexp
gawk: cmd. line:2: /[/
gawk: cmd. line:2:    ^ unexpected newline
%

Seems OK to me (Unix, tcsh, gawk 3.1.3).


Report this thread to moderator Post Follow-up to this message
Old Post
Kenny McCormack
09-16-04 03:51 PM


Re: metachar in awk 3.1.3 under cygwin
"Kenny McCormack" <gazelle@yin.interaccess.com> a écrit dans le message de
news:ci9js3$c5d$1@yin.interaccess.com...
> In article <41484be1$0$15755$7a628cd7@news.club-internet.fr>,
> Gilles DRIDI <gdridi@club-internet.fr> wrote:
> --- Cut Here ---
> BEGIN {}
> {
> toto($0)
> }
>
> END {}
> function toto(t) {
> if ( match(t, "[[]") ) {
> print t, "[ found"
>
> # below sub(r, s, t) regular expression [ followed by ]
> # sub(substr(t, RSTART, RLENGTH), "", t)
> # instead of (thanks to Aharon Robbins)
>
> t= substr(t, 1, RSTART-1) substr(t, RSTART+RLENGTH)
> }
> }
> --- Cut Here ---
>
> And your point is?
>
It was just a post to, for the solution



Report this thread to moderator Post Follow-up to this message
Old Post
Gilles DRIDI
09-17-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:13 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.