The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl question regarding [ ] hankooknara Shell Programming and Scripting 2 07-01-2007 04:21 PM
Perl Question serm Shell Programming and Scripting 2 09-28-2006 05:50 AM
perl question BG_JrAdmin Shell Programming and Scripting 1 09-09-2005 07:46 PM
PERL question frank Shell Programming and Scripting 1 06-18-2002 03:13 AM
Perl question Jubba Shell Programming and Scripting 1 04-01-2002 02:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2004
Gary Dunn Gary Dunn is offline
Registered User
  
 

Join Date: Jun 2004
Location: Il, hoffman estates.
Posts: 18
Question Perl Question

I do not know perl but need to know what the following conditional statement says. Can someone help ?

if (/ \S+@\S+\.\S+ accepted $| \S+\/\S+ accepted $/) {
next;
}
elsif (/ (\S+)\.\S+\.\S+\.\S+ \S+ \S+ \S+ \S+ \S+ (\S+)\.\S+\.(\S+)\.\S+ \S+ User (\S+) accepted $/) {
...


I think it says if some string separted by '@" plus some string and the word accepted OR some string separated with an '/' plus remaining string then skip ( next )
else some series of strings ( have no idea what all that means ) having User ( then something ???) and accepted then do processing ...
???
thanks

Last edited by Gary Dunn; 12-02-2004 at 05:59 PM..
  #2 (permalink)  
Old 12-02-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
The first match looks like matching some email address or file path in a message.

The second matches some string delimited by . (dot). It should serve some extraction from fixed columns but I won't know what it is trying to match.

\S means a non-whitespace character, so anything other than tab, space, etc. will match. \. is a dot, and () means to backtrack a matched expression so that the matched content will be accessible in some later statements.

Actually, you should be able to find out more about Perl regular expressions in the perlre manpage.
  #3 (permalink)  
Old 12-03-2004
Gary Dunn Gary Dunn is offline
Registered User
  
 

Join Date: Jun 2004
Location: Il, hoffman estates.
Posts: 18
thanks!

I suspect the '+" sign indicates one or more character or simply a string ?
Closed Thread

Bookmarks

Tags
regex, regular expressions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0