Current location: Hot Scripts Forums » Programming Languages » Perl » Pearl condition


Pearl condition

Reply
  #1 (permalink)  
Old 09-28-05, 11:32 PM
rickyisidro rickyisidro is offline
New Member
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Pearl condition

Does any one can explain this IF condition in a high level explanation

$LFB='(RMK\s|HTG\s|MWS\d|HML\s|ACC\s|INT\s|SLA\s|D PA\s|MW\d\s|SA\s|CKL\s|SN\s|SUS\s|CPG\s|TSC\s|OCL\ s|PRI\s|BG\s|TRC\s|TGP\s|DNP\s)';


if (/^(\s{2}|)([A-Z]|)$LFB\s{0,2}([\w\W]+.*\S{1}|\s{44})(\s*)$/)



Thanks in advance,

Ricky
Reply With Quote
  #2 (permalink)  
Old 11-02-05, 11:16 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
That takes the value of $LFB and uses it as part of the regex. I'm not all that great with regexes so I won't spend time trying to trace it out. If you want more details you can take a look at a couple of the Perl rexex tutorials:

perlrequick: http://perldoc.perl.org/perlrequick.html
perlretut: http://perldoc.perl.org/perlretut.html

perlre: http://perldoc.perl.org/perlre.html
perlreref: http://perldoc.perl.org/perlreref.html

This particular section will be very handy:
http://perldoc.perl.org/perlrequick....hical-matching

~Charlie
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
condition within a condition id10tn00b PHP 4 06-07-05 03:27 PM
Pearl script example - Help required - urgent!!! Geeta_Sharma HTML/XHTML/XML 1 04-25-05 09:28 AM
Help needed in pearl event handling naveen_chandra Perl 2 04-24-05 12:30 AM
Pearl Forums obai PHP 0 03-03-05 03:46 PM
Condition Zero Gaming community crayolacrayon General Advertisements 0 02-02-05 10:00 AM


All times are GMT -5. The time now is 04:07 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.