Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Perl, Regular expression?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
Hi all,

I am a C language user.

For I want use Perl to find division symbol "/" in C source file. And I want to exclude the line with only comment symbol "*/" or "/*" or "//". i.e. line with both division symbol "/" and comment symbols should be included.

----File.c begin----
NOT MATCH /* File.c
NOT MATCH Auther: abc
NOT MATCH Date:2005*/
MATCH c = a/b;
MATCH d = e/f; //division
NOT MATCH //division
----File.c end------

Happy holiday!
Davy
 

Hi Davy, try the following.

/[\d\w ]\/[\d\w ]/
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top