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 7545599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:58:18+00:00 2026-05-30T08:58:18+00:00

Possible Duplicate: How to search for a string in files with Ant (make sure

  • 0

Possible Duplicate:
How to search for a string in files with Ant (make sure certain string isn't found in source files)

I am working on a project with a small team (~5 developers) and we would like to ensure that a list of words does not end up in our source code. This code is a extGWT project and we are using an ANT build script to build and deploy our project. We have a text file that has the list of bad words. The build will happen on a linux machine so I have access to find and grep and the like. I can just have the build fail if a bad word is found and we can then do a search of the source code to find where the bad word is located. Any hints on getting this working would be a huge help.

  • 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-30T08:58:20+00:00Added an answer on May 30, 2026 at 8:58 am

    Thanks to all the comments I received I was able to solve my issue and I thought I would put my full solution here for future reference.

    <target name="badword-search" description="search for bad words">
            <echo>Doing badword-serach</echo>
            <property name="src.dir" value="src" />
            <property name="search.string" value="\b(word1|word2|word3)\b" />
    
            <fileset id="existing" dir="${src.dir}">
                <patternset id="files">
                    <!-- includes/excludes for your source here -->
                </patternset>
            </fileset>
    
            <fileset id="matches" dir="${src.dir}">
                <patternset refid="files" />
                <containsregexp expression="${search.string}" casesensitive="false" />
            </fileset>
    
            <fail message="Found badword in one or more files in '${src.dir}'">
                <condition>
                    <resourcecount when="greater" count="0" refid="matches" />
                </condition>
            </fail>
        </target>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Search for string allowing for one mismatch in any location of the
Possible Duplicate: Oracle Search all tables all columns for string I'm looking for a
Possible Duplicate: php scandir --> search for files/directories I have a folder, inside this
Possible Duplicate: Are there any Fuzzy Search or String Similarity Functions libraries written for
Possible Duplicate: XPath: How to match attributes that contain a certain string I'm trying
Possible Duplicate: How to make a search function for sql database , and how
Possible Duplicate: How to make a search function for sql database , and how
Possible Duplicate: byte[] array pattern search I am trying to write a simple compression
Possible Duplicate: What does ||= (or equals) mean in Ruby? It's hard to search
Possible Duplicate: Regex.IsMatch vs string.Contains Which is faster, preferable and why? What the difference

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.