How about the 2nd case,2) I have name=servername , i want to still capture the first part in a variable. In this your code will not work. we need to match a-zA-Z character after =
Update:my $str='name=host.com' my ($match) =$string=~/=([a-zA-Z]+)/;
Updated the regex part as per CountZero's node Re^3: Steps to get a substring from a string
In reply to Re^2: Steps to get a substring from a string
by vinoth.ree
in thread Steps to get a substring from a string
by shroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |