Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6017869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:11:30+00:00 2026-05-23T03:11:30+00:00

I have a file lets say it is called filename.c I am trying to

  • 0

I have a file lets say it is called

                                 filename.c

I am trying to find if the file is being used in one of the following ways

                          1.  include("filename.c");
                          2.   require("filename.c");
                          3.   x = new filename() ; 
                          4.   class new_class extends filename
                          5.   class new_class implements filename
                          6.   filename::function()

I am wondering if perl will allow me to do all the above search at once or I just have to do them one by one?

And also I am not very good at regular expressions so I am wondering how can I grep the string
extends filename
implement filename

the space in between is giving me problems. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:11:31+00:00Added an answer on May 23, 2026 at 3:11 am

    what is wrong with grep?

    W="filename"
    find . -type f -print0 | xargs -0 grep -ilP "include(\"$W\.c\")|require(\"$W\.c\")|x\s*=\s*new\s+$W()|class\s+new_class\s+extends\s+$W|class\s+new_class\s+implements\s+$W|$W::function()"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have the following file in called index in the directory D:\Experimental:
Ok lets say I have a File called File.txt and it contains Hello World
Lets say we have the following in the default.aspx file <asp:Literal runat=server Text=<%= TestMethod()
Lets say I have a file called foo.txt encoded in utf8: aoeu qjkx ñpyf
lets say i have 5 lines within a txt file called users.txt each line
I have a file lets say c:\file1.txt that has an ADS file lets say
Lets say we have a log file (preferably a txt file) available in the
I have a header file, lets say Common.h, that is included in all of
Lets say I have 10 lines in a file. I have 2 parameters that
Lets say I have a modestly sized text file (~850kb, 10,000+ lines) And I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.