title: Regular Expression That Contains All Of The Specific Letters In Java
body: <p>I have a regular expression, which selects all the words that contains <strong>all</strong> (not! any) of the specific letters, just works fine on Notepad++. </p>
  
  <p>Regular Expression Pattern;</p>
  
  <pre><code>^(?=.*B)(?=.*T)(?=.*L).+$
  </code></pre>
  
  <p>Input Text File;</p>
  
  <pre><code>AL
  BAL
  BAK
  LABAT
  TAL
  LAT
  BALAT
  LA
  AB
  LATAB
  TAB
  </code></pre>
  
  <p>And output of the regular expression in notepad++;</p>
  
  <pre><code>LABAT
  BALAT
  LATAB
  </code></pre>
  
  <p>As It is useful for Notepad++, I tried the same regular expression on java but it is simply failed.</p>
  
  <p>Here is my test code;</p>
  
  <pre><code>import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  import com.lev.kelimelik.resource.*;
  
  public class Test {
  
      public static void main(String[] args) {
          String patternString = "^(?=.*B)(?=.*T)(?=.*L).+$";
  
          String dictionary = 
                  "AL" + "\n"
                  +"BAL" + "\n"
                  +"BAK" + "\n"
                  +"LABAT" + "\n"
                  +"TAL" + "\n"
                  +"LAT" + "\n"
                  +"BALAT" + "\n"
                  +"LA" + "\n"
                  +"AB" + "\n"
                  +"LATAB" + "\n"
                  +"TAB" + "\n";
  
          Pattern p = Pattern.compile(patternString, Pattern.DOTALL);
          Matcher m = p.matcher(dictionary);
          while(m.find())
          {
              System.out.println("Match: " + m.group());
          }
      }
  
  }
  </code></pre>
  
  <p>The output is <strong>errorneous</strong> as below;</p>
  
  <pre><code>Match: AL
  BAL
  BAK
  LABAT
  TAL
  LAT
  BALAT
  LA
  AB
  LATAB
  TAB
  </code></pre>
  
  <p>My question is simply, what is the java-compatible version of this regular expression?</p>