title: Is there a way to find the EXACT string of a word in a discord message?
body: <p>Currently I am working on a discord bot, which is filtering messages. My problem occurs when trying to filter words, which are included in others, thus triggering duplicate messages.</p>
  <p>This is my filter.txt:</p>
  <pre><code>sad
  sadness
  sadnesses
  </code></pre>
  <p>Since &quot;sad&quot; can be found in &quot;sadness&quot; as well, I get a false-positive for &quot;sad&quot; whenever &quot;sadness&quot; is written.<br />
  Is it possible to only detect the exact string in a message? Like: <code>I want to be happy, because sadness is bad </code> → '<em>Just detect sadness</em>'</p>
  <p>I hope you understand what i mean.</p>
  <p>Code:</p>
  <pre><code>public void onGuildMessageReceived(GuildMessageReceivedEvent e) {
      File file = new File(&quot;src/filter.txt&quot;);
      try {
          BufferedReader br = new BufferedReader(new FileReader(file));
          String line;
          while ((line = br.readLine()) != null) {
              if(!line.startsWith(&quot;#&quot;)) {
                  if(e.getMessage().getContentRaw().contains(line)) {
                      User user = e.getJDA().getUserById(e.getAuthor().getIdLong());
                      e.getMessage().delete().queue();
                      user.openPrivateChannel().queue(privateChannel -&gt; {
                          privateChannel.sendMessage(&quot;Bitte achte auf deine Sprache!&quot;).queue();
                      });
                  }                   
              }
          }
      } catch (IOException e1) {}
  }
  </code></pre>