Regular Exression help
- From: sandeepsirsgi@xxxxxxxxxxxxxx (Sandy)
- Date: Thu, 27 Apr 2006 08:38:01 -0500
Hi,
The content of file hello.c is as given below.
I want to count how many + and - are there in this file.
I had equivalent shel command to count no. of + and -,
grep -e "^+[^+]" diffs.txt | wc -l
grep -e "^-[^-]" diffs.txt | wc -l
Can anyone help me how to write perl script using regular expression
which should count no. of + and -.
+++ hello.c 8 Mar 2006 13:55:13 -0000 1.9
@@ -1,16 +1,19 @@
+func()
+{
+ print("eep Si\n";
+printf("This line has been added after first commit by sandeep");
+printf("Hi iam last time committing");
+printf("Hi iam inserting some change in the code.");
+}
-Hi ther i have been here
-
-hi ther good one
-
-Hi iam last time committing
-
-jkdklsf asdf
-Hi iam inserting some change in the code.
Thank you
Regards
Sandeep
.
- Follow-Ups:
- Re: Regular Exression help
- From: usenet
- Re: Regular Exression help
- Prev by Date: How To Post (WAS: Chomp method)
- Next by Date: Re: problem with whitespace not splitting on split.
- Previous by thread: Running local scripts remotely
- Next by thread: Re: Regular Exression help
- Index(es):