title: Validating AWS Access and Secret Keys
body: <p>The regular expressions for AWS access key ids and secret keys <a href="https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/" rel="nofollow noreferrer">from the AWS security blog</a> are:<br>
  AKID: <code>(?&lt;![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])</code><br>
  SK: &nbsp;&nbsp;&nbsp;<code>(?&lt;![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])</code></p>
  
  <p>When I try to use these with the Go <a href="https://godoc.org/regexp" rel="nofollow noreferrer">regexp</a> package, it gives the following error for both expressions: <code>error parsing regexp: invalid or unsupported Perl syntax: `(?&lt;`</code>. I know that the Go regexp package does not fully support the Perl syntax, but I'm not sure how to represent the same expression so that it is supported by Go.</p>
  
  <p>Any help would be appreciated.</p>