Hi all
I have the following problem. I am using PERL language to read text file, and in this file I use pattern matching to search for specific line formatting. I need this because I am analyzing big code output.
For instance if I look for line such as
44.333e-02 44.221e-03 22.332e-04
I can define in PERL
Where $1,$2,$3 are perl notation to say what is matched in the first second third bracket . This shall store the desired objects matched in the above specified pattern in @A,@B,@C arrays.Code:if($line=~/(\d{2}\.\d{3}e-\d{2}) +(\d{2}\.\d{3}e-\d{2}) +(\d{2}\.\d{3}e\d{2})/) { $a[$i++]=$1 ; $B[$j++]=$2 ; $C[$k++]=$3 ; }
Is it possible to do this in C++. In ordinary C there are functions regcomp() regexec() which are an option but are rather complicated compared with the simple perl procedure.
Thank you in advance



LinkBack URL
About LinkBacks


