LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2013, 12:04 PM   #1
stillsmil
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
Gawk: is there grouping-only parentheses ? Seems it's confused with the capturing one


I scan an html file with this pattern
Code:
pattern="(exp)*(interesting)"
and wish to retrieve the "interesting" part with
Code:
gensub(pattern,"\\1",g)
until I realize that the first parentheses (which are intended to indicate priority) are used for back-reference.
In other regexp implementations there is something like
Code:
(?:exp)
for grouping-only purposes.
Is there anything for grouping-only parentheses in gawk/awk ?
Or any sugestions if I have to turn to different softwares ?

Thanks in advance!

Last edited by stillsmil; 01-20-2013 at 12:07 PM. Reason: formatting , add some code tags
 
Old 01-20-2013, 01:00 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Yes, depending on the complexity of your script probably perl would be a better choice.
see here some discussion
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with sed and parentheses. Allis Linux - Newbie 4 12-24-2011 03:16 PM
what is the meaning of underline that before parentheses? skiron.liu Programming 1 06-22-2010 09:35 AM
using sed with parentheses in perl beebop Linux - General 2 07-21-2005 10:41 PM
Emacs config and parentheses jrdioko Linux - Software 0 07-16-2005 03:14 PM
Capturing video with Cinelerra works, capturing video with Xawtv doesn't! seaelf Slackware 0 06-27-2004 05:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration