![]() |
trouble with regular exp.
define F0_FN_C_B 0800 4:0 s_x_f_c 0800 gg 09 F_C_BL
this is a line from a file and I want to extract the last column in the line which is in this case 'F_C_BL' how do I do that? |
Re: trouble with regular exp.
The Line which u have mentioned :
define F0_FN_C_B 0800 4:0 s_x_f_c 0800 gg 09 F_C_BL Considering/ Assuming before the sub-string (F_C_BL) , there will be a 2 digit number followed by a space , i write this regular expression. [\w\W\s*]\d\d\s([A-Za-z0-9]+)\s*\-([A-Za-z0-9]+)\s*\-([A-Za-z0-9]+)\s* I think the above regex will work fine....Thank you.:pleased: |
Re: trouble with regular exp.
$a='F0_FN_C_B 0800 4:0 s_x_f_c 0800 gg 09 F_C_BL';
$a=~/.*\d\d /; print "$'\n"; same asumptions |
Re: trouble with regular exp.
Code: Perl
|
| All times are GMT +5.5. The time now is 20:37. |