LinuxQuestions.org
Help answer threads with 0 replies.
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 08-18-2010, 04:10 AM   #31
gfarrell
LQ Newbie
 
Registered: May 2010
Location: London
Distribution: Mac OSX, Ubuntu, Debian
Posts: 29

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by ghostdog74 View Post
Code:
awk -vRS="}" '/myFunction:/{
    gsub(/.*myFunction:/,"myFunction: (")
    gsub(/{.[^}]*/,"...\n"); 
    print $0RT")" 
}' file
Unfortunately this has only a limited application. I did not, however, realise that awk could do regex, which it can, by the looks of your answer.

My original regex was quite sufficient, I would love to know why it didn't work in perl but did in two regex testers.
 
  


Reply

Tags
perl, regex


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Perl Regex matching HTML hawk__0 Programming 2 03-19-2010 07:57 PM
php preg_replace and perl regex matching aolong Programming 1 06-02-2009 05:32 PM
Matching two wildcards with perl and regex borinus Programming 3 09-09-2008 04:04 AM
Embedded regex matching in Perl GATTACA Programming 5 01-17-2007 09:16 AM
perl regex matching exodist Programming 2 11-15-2004 10:50 PM


All times are GMT -5. The time now is 06:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration