I have a string which can take of 2 forms which I have mentioned below, which is part of the code
The string can be either of 2 forms and I need to split in the first case like$def1 = "!defined(FLOAT_CODE)"; $def2 = "defined(FIXED_CODE)";
! FLOAT_CODE
and in the second case like
FIXED_CODE
but a single statement has to do it, I do not want 2 separate case for each one. Below is my perl code with different variant I have tried.
Variant:1
This gives me likem/^(!defined|defined)\((.*?)\)$/; print "$1----$2\n";
Variant 2:output case1: !defined----FLOAT_CODE output case2: defined----FIXED_CODE
m/^(\!|defined)(.*?)$/; print "$1----$2\n";
output case1: !----defined(FLOAT_CODE) output case2: defined----(FIXED_CODE)
But both are not helping me in solving the issue can you please help in solving this or any other method avaliable.
Regards,
-Prassi
In reply to extracting data from string by prassi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |