jai has asked for the wisdom of the Perl Monks concerning the following question:
I need to extract the function definition from the text file. The output should be similar to the following.5.1. GetTagBytestoWrite This function returns the number of bytes taken by the Tag of the ASN + object. It Scans through the BER/DER encoded String and finds the no + of bytes taken by the Tag of a given ASN.1 Object. Prototype: int GetTagbytestoWrite(unsigned char *tstr,int *count) Parameters: *tstr Contents of the ASN.1 Object in a string *count a pointer to an integer to hold the address of the variable holding the +number of bytes the tag value takes to store itself. 5.2. GetLenBytestoWrite This function returns the no of Octets taken by the Length field of a given ASN.1 Object. It Scans through the BER/DER encoded St +ring and finds the no of bytes taken by the Length field of a given A +SN.1 Object. Prototype: int GetLenbytestoWrite(unsigned char *pstr,int *count) Parameters: *pstr Contents ..
I did something like this..5.1. GetTagBytestoWrite This function returns the number of bytes taken by the Tag of the ASN + object. It Scans through the BER/DER encoded String and finds the no + of bytes taken by the Tag of a given ASN.1 Object. 5.2. GetLenBytestoWrite This function returns the no of Octets taken by the Length field of a given ASN.1 Object. It Scans through the BER/DER encoded St +ring and finds the no of bytes taken by the Length field of a given A +SN.1 Object. ..
But this doesnt seem to work.. any help would be greatly appreciated..#!/usr/bin/perl my ($buf); open (FILE,"./ASN_tech.htm") or die "Unable to open: $!"; $buf=join '',<FILE>; close FILE; $buf=~s/(\d*\.\d*\.)\s*(\w+)(.*)?(Prototype:)/print "$1 $2\n"/gem;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex help
by tachyon (Chancellor) on Sep 16, 2003 at 07:10 UTC | |
|
Re: regex help
by leriksen (Curate) on Sep 16, 2003 at 07:55 UTC | |
|
Re: regex help
by delirium (Chaplain) on Sep 16, 2003 at 12:46 UTC |