Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question abt Pattern Matching

Status
Not open for further replies.

maskman0

Programmer
Jul 24, 2007
9
US
Hi im new to perl can some one explain me, what do these patterns look for ?

next if m/^\s*#/;
next if m/^\s*$/;
if (m/^\s*\[\s*(.*)\s*\]/)
next unless m/^\s*([^=\s]+)\s*=\s*(.*)\s*$/;

value =~ s/#.*//;
$value =~ s/^\s*//;
$value =~ s/\s*$//;
$value =~ s/^"//;
$value =~ s/"$//;
$value =~ s/^'//;
$value =~ s/'$//;


thanks
 
I read it & tried ..but could not et my answer ....could you please explain 2 -3 of these patterns ...ill try to fiure out rest.

Thanks
 
$value =~ s/^"//;
Means that it starts with "
$value =~ s/"$//;
Means it ends with "


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top