0

Good day,

I am attempting to use REGEX in Java to match certain strings from a document.

It was performing fine until I noticed that there are certain strings in the documents that are break into 2 lines and therefore the REGEX is unable to pick them up.

if (extract[i].matches("^[a-fA-F0-9]{32}$")) 
{
            System.out.println(extract[i]);
} 

So with the above snippet, I can match strings such as "49f68a5c8493ec2c0bf489821c21fc3b"

However, the REGEX can't pick up the string if it is split into multiple lines:

49f68a5c8493ec2c0bf489821
c21fc3b

Thank you.

kenAu89
  • 101
  • 1
  • 11
  • just checking, those two lines are extract[i] and not extract[i] and extract[i+1], right? – Leo May 11 '16 at 01:49
  • Hi @Leo, it is extract[i]. but the issue I am having is matching the string which are split into 2 lines. – kenAu89 May 11 '16 at 01:52

0 Answers0