CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [agutal] Help Needed for Pattern Matchin for Variable Seperator. : Edit Log



vikas.deep
User

May 11, 2009, 1:23 AM


Views: 14056
Re: [agutal] Help Needed for Pattern Matchin for Variable Seperator.

I don't think anybody can guess about the level of complexity you are working on unless you explicitly tell.
Further the example you have come up can be easily done with using the following
while (<$FH>)
{
if ($_ =~ /(.+(.+(x).*)\+\d+)/)
{$_ =~ s/$+/Taint/;
}
print "\n",$_

#This will give you the following
#[root@localhost Documents]# perl sur.pl

#o = (malloc(sizeof(Taint))+1);

but as you can see that this is a very specific solution to the specific question you put up and each time you have to design a new regex depending on the problem.
I guess you are searching for some general solution that can be applied to a wide variety of problems. Still if you mean
" for all the variable operations in C language"
It is beyond my knowledge--
Somebody else might suggest you a still better or elegant way to do it
-For all my suggestions " I am sure someone else can do it in a better or elegant manner!"

(This post was edited by vikas.deep on May 11, 2009, 1:27 AM)


Edit Log:
Post edited by vikas.deep (User) on May 11, 2009, 1:27 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives