Sponsored Content
Top Forums Shell Programming and Scripting Understanding regex behaviour when using quantifiers Post 302749725 by chidori on Saturday 29th of December 2012 05:36:38 AM
Old 12-29-2012
:)

Quote:
Originally Posted by jim mcnamara
There even more interesting aspects to regular expressions.
Consider reading the 'owl' book: Mastering Regular Expressions 3rd Ed by J. Friedl
Thanks, I got one already. Guess its good time to start reading that Smilie

Thanks to all who for a brief explanation on this Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

2. Shell Programming and Scripting

find: "weird" regex behaviour

I have these two files in current dir: oos.txt oos_(copy).txt I execute this find command:find . -regex './oos*.txt'And this outputs only the first file (oos.txt)! :confused: Only if I add another asterisk to the find find . -regex './oos*.*txt' do I also get the second file... (7 Replies)
Discussion started by: courteous
7 Replies

3. Shell Programming and Scripting

Understanding a regex

Hi, Please help me to understand the bold segments in the below regex. Both are of same type whose meaning I am looking for. find . \( -iregex './\{6,10\}./src' \) -type d -maxdepth 2 Output: ./20111210.0/src In continuation to above: sed -e 's|./\(*.\{1,3\}\).*|\1|g' Output: ... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

4. Shell Programming and Scripting

help understanding regex with grep & sed

I have the following line of code that works wonders. I just don't completely understand it as I am just starting to learn regex. Can you help me understand exactly what is happening here? find . -type f | grep -v '^\.$' | sed 's!\.\/!!' (4 Replies)
Discussion started by: trogdortheburni
4 Replies

5. Shell Programming and Scripting

Need Quick help on Understanding sed Regex

Hi Guys, Could you please kindly explain what exactly the below SED command will do ? I am quite confused and i assumed that, sed 's/*$/ /' 1. It will remove tab and extra spaces .. with single space. The issue is if it is removing tab then it should be Î right .. please assist.... (3 Replies)
Discussion started by: Nandy
3 Replies

6. Shell Programming and Scripting

Perl, RegEx - Help me to understand the regex!

I am not a big expert in regex and have just little understanding of that language. Could you help me to understand the regular Perl expression: ^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{ ------ This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies

7. Shell Programming and Scripting

Need help understanding this Regex.

Hi everyone, This regex looks simple and yet it doesn't make sense how it's manipulating the output. ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0c:49:c2:35:6v inet addr:192.16.1.1 Bcast:192.168.226.255 Mask:255.255.255.0 inet6 addr:... (2 Replies)
Discussion started by: xcod3r
2 Replies

8. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies

9. UNIX for Beginners Questions & Answers

Help with understanding this regex in a Perl script parsing a 'complex' string

Hi, I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies

10. Programming

Regarding a GREAT site for understanding and Visualizing regex patterns.

Hello All, While googling on regex I came across a site named Regulex Regulex:JavaScript Regular Expression Visualizer I have written a simple regex ^(a|b|c)(*)@(.*) and could see its visualization; one could export it too, following is the screen shot. ... (3 Replies)
Discussion started by: RavinderSingh13
3 Replies
PERLBOOK(1)						 Perl Programmers Reference Guide					       PERLBOOK(1)

NAME
perlbook - Books about and related to Perl DESCRIPTION
There are many books on Perl and Perl-related. A few of these are good, some are OK, but many aren't worth your money. There is a list of these books, some with extensive reviews, at http://books.perl.org/ . We list some of the books here, and while listing a book implies our endorsement, don't think that not including a book means anything. Most of these books are available online through Safari Books Online ( http://safaribooksonline.com/ ). The most popular books The major reference book on Perl, written by the creator of Perl, is Programming Perl: Programming Perl (the "Camel Book"): by Larry Wall, Tom Christiansen, and Jon Orwant ISBN 978-0-596-00027-1 [3rd edition July 2000] http://oreilly.com/catalog/9780596000271/ The Ram is a cookbook with hundreds of examples of using Perl to accomplish specific tasks: The Perl Cookbook (the "Ram Book"): by Tom Christiansen and Nathan Torkington, with Foreword by Larry Wall ISBN 978-0-596-00313-5 [2nd Edition August 2003] http://oreilly.com/catalog/9780596003135/ If you want to learn the basics of Perl, you might start with the Llama book, which assumes that you already know a little about programming: Learning Perl (the "Llama Book") by Randal L. Schwartz, Tom Phoenix, and brian d foy ISBN 978-0-596-52011-3 [5th edition June 2008] http://oreilly.com/catalog/9780596520113 The tutorial started in the Llama continues in the Alpaca, which introduces the intermediate features of references, data structures, object-oriented programming, and modules: Intermediate Perl (the "Alpaca Book") by Randal L. Schwartz and brian d foy, with Tom Phoenix foreword by Damian Conway ISBN 978-0-596-00478-1 [1st edition March 2006] http://oreilly.com/catalog/9780596004781/ References You might want to keep these desktop references close by your keyboard: Perl 5 Pocket Reference by Johan Vromans ISBN 978-0-596-00374-6 [4th edition July 2002] http://oreilly.com/catalog/9780596003746/ Perl Debugger Pocket Reference by Richard Foley ISBN 978-0-596-00503-0 [1st edition January 2004] http://oreilly.com/catalog/9780596005030/ Regular Expression Pocket Reference by Tony Stubblebine ISBN 978-0-596-51427-3 [July 2007] http://oreilly.com/catalog/9780596514273/ Tutorials Beginning Perl by James Lee ISBN 1-59059-391-X [3rd edition April 2010] http://www.apress.com/book/view/1430227931 Learning Perl by Randal L. Schwartz, Tom Phoenix, and brian d foy ISBN 978-0-596-52010-6 [5th edition June 2008] http://oreilly.com/catalog/9780596520106 Intermediate Perl (the "Alpaca Book") by Randal L. Schwartz and brian d foy, with Tom Phoenix foreword by Damian Conway ISBN 0-596-10206-2 [1st edition March 2006] http://oreilly.com/catalog/9780596102067 Mastering Perl by brian d foy ISBN 978-0-596-10206-7 [1st edition July 2007] http://www.oreilly.com/catalog/9780596527242 Effective Perl Programming by Joseph N. Hall, Joshua A. McAdams, brian d foy ISBN 0-321-49694-9 [2nd edition 2010] http://www.effectiveperlprogramming.com/ Task-Oriented Writing Perl Modules for CPAN by Sam Tregar ISBN 1-59059-018-X [1st edition August 2002] http://www.apress.com/book/view/159059018X The Perl Cookbook by Tom Christiansen and Nathan Torkington with foreword by Larry Wall ISBN 1-56592-243-3 [2nd edition August 2003] http://oreilly.com/catalog/9780596003135 Automating System Administration with Perl by David N. Blank-Edelman ISBN 978-0-596-00639-6 [2nd edition May 2009] http://oreilly.com/catalog/9780596006396 Real World SQL Server Administration with Perl by Linchi Shea ISBN 1-59059-097-X [1st edition July 2003] http://www.apress.com/book/view/159059097X Special Topics Regular Expressions Cookbook by Jan Goyvaerts and Steven Levithan ISBN 978-0-596-52069-4 [May 2009] http://oreilly.com/catalog/9780596520694 Programming the Perl DBI by Tim Bunce and Alligator Descartes ISBN 978-1-56592-699-8 [February 2000] http://oreilly.com/catalog/9781565926998 Perl Best Practices by Damian Conway ISBN: 978-0-596-00173-5 [1st edition July 2005] http://oreilly.com/catalog/9780596001735 Higher-Order Perl by Mark-Jason Dominus ISBN: 1-55860-701-3 [1st edition March 2005] http://hop.perl.plover.com/ Mastering Regular Expressions by Jeffrey E. F. Friedl ISBN 978-0-596-52812-6 [3rd edition August 2006] http://oreilly.com/catalog/9780596528126 Network Programming with Perl by Lincoln Stein ISBN 0-201-61571-1 [1st edition 2001] http://www.pearsonhighered.com/educator/product/Network-Programming-with-Perl/9780201615715.page Perl Template Toolkit by Darren Chamberlain, Dave Cross, and Andy Wardley ISBN 978-0-596-00476-7 [December 2003] http://oreilly.com/catalog/9780596004767 Object Oriented Perl by Damian Conway with foreword by Randal L. Schwartz ISBN 1-884777-79-1 [1st edition August 1999] http://www.manning.com/conway/ Data Munging with Perl by Dave Cross ISBN 1-930110-00-6 [1st edition 2001] http://www.manning.com/cross Mastering Perl/Tk by Steve Lidie and Nancy Walsh ISBN 978-1-56592-716-2 [1st edition January 2002] http://oreilly.com/catalog/9781565927162 Extending and Embedding Perl by Tim Jenness and Simon Cozens ISBN 1-930110-82-0 [1st edition August 2002] http://www.manning.com/jenness Pro Perl Debugging by Richard Foley with Andy Lester ISBN 1-59059-454-1 [1st edition July 2005] http://www.apress.com/book/view/1590594541 Free (as in beer) books Some of these books are available as free downloads. Higher-Order Perl: http://hop.perl.plover.com/ Writing Perl Modules for CPAN: http://www.apress.com/resource/freeebook/9781590590188 Other interesting, non-Perl books You might notice several familiar Perl concepts in this collection of ACM columns from Jon Bentley. The similarity to the title of the major Perl book (which came later) is not completely accidental: Programming Pearls by Jon Bentley ISBN 978-0-201-65788-3 [2 edition, October 1999] More Programming Pearls by Jon Bentley ISBN 0-201-11889-0 [January 1988] A note on freshness Each version of Perl comes with the documentation that was current at the time of release. This poses a problem for content such as book lists. There are probably very nice books published after this list was included in your Perl release, and you can check the latest released version at http://perldoc.perl.org/perlbook.html . Some of the books we've listed appear almost ancient in internet scale, but we've included those books because they still describe the current way of doing things. Not everything in Perl changes every day. Many of the beginner-level books, too, go over basic features and techniques that are still valid today. In general though, we try to limit this list to books published in the past five years. Get your book listed If your Perl book isn't listed and you think it should be, let us know. perl v5.14.2 2011-09-26 PERLBOOK(1)
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy