9 Replies Latest reply on Nov 14, 2009 11:57 AM by 800308

    Regex code to include words but not numbers


      I wanted to find all the words in a file but not the numbers or digits.

      I am using this line of code but not getting the ideal results.
      Pattern p = Pattern.compile("[\\w']+[\\D]",Pattern.MULTILINE);
      Again, I dont want the numbers. Without the numbers part the code is giving me the words with the numbers ie if I dont use the [\\D] part.

      This is working fine: ie gives the words with the digits:
      Pattern p = Pattern.compile("[\\w']+",Pattern.MULTILINE);