7

On the following text

MD5 ed076287532e86365e841e92bfc50d8c
SHA1 2ef7bde608ce5404e97d5f042f95f89f1c232871
SHA256 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069 
ssdeep3:aBn:aB 
File size 12 bytes ( 12 bytes ) 
File type Text 
Magic literal ASCII text, with no line terminators 
TrID    Unknown!

I want to match the hash the SHA256 value in JS:

7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069 
Ricardo
  • 3,696
  • 5
  • 36
  • 50
  • @NicolasMaltais thanks for the comment. I mentioned this question on a comment on my answer below. Although related, both are asking two different things. – Ricardo Apr 25 '17 at 00:44
  • I actually created this question just to document the specific case for matching a SHA256 word in JS. Please note the mentioned question wants to know how it looks like, not the regex. – Ricardo Apr 25 '17 at 00:45
  • No offence, but the regex needed to match that is rather basic, I don't see the need to "document" it. Enforcing this further since it also is a duplicate. – vallentin Apr 25 '17 at 00:49
  • 1
    The mentioned question is not about regex or js; although not agreeing, I understand why some may think it's a duplication. Please do not delete this QA, since some users may not think it's basic and benefit from this effort. Thanks, – Ricardo Apr 25 '17 at 01:28

1 Answers1

10

The following regex works for me:

\b[A-Fa-f0-9]{64}\b

Check the explanation here: https://regex101.com/r/AXhQLz/1

Ricardo
  • 3,696
  • 5
  • 36
  • 50
  • Related [SO link](http://stackoverflow.com/questions/6630168/what-does-sha256-hexadecimal-string-look-like/) – Ricardo Apr 25 '17 at 00:19