Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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
 

seanwu

Member level 2
Joined
Sep 24, 2004
Messages
44
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
329
Hi Davy, try the following.

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

    davyzhu

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top