<blockquote>
  <p>[^13][a-km-zA-HJ-NP-Z1-9]{25,34}$.</p>
</blockquote>

<p>...</p>

<blockquote>
  <p><strong>I removed the ^ and $ from the ends after when I realized that there is no reason to think it's at the beginning or end of a line ...</strong></p>
</blockquote>

<p>As you noted, the trailing dollar sign (<code>$</code>) anchors the search expression to an end-of-line (e.g. LF on Linux) - you probably do not want to do that.</p>

<p>However the <code>[^13]</code> does <em>not</em> anchor the search to start of line, inside square-brackets, the caret <code>^</code> means not. So <code>[^13]</code> means look for a string whose first 8-bit character is not a <code>1</code> nor a <code>3</code>. It would match strings that begin with any other character - that is probably not what you want. If you want a string that begins with a <code>1</code> or a <code>3</code> just use <code>[13]</code>. If you wanted to anchor that to the start of a line you'd use <code>^[13]</code> not <code>[^13]</code>.</p>

<blockquote>
  <p><strong>... (if I properly understand what that even means).</strong></p>
</blockquote>

<p>The expression <code>^[13][a-zA-Z0-9]{25,34}</code> matches these lines:</p>

<pre><code>1234567890123456789012345 is my secret code
3aklsdjlajkjvcnbxuxcjvhhkjhgtresds
</code></pre>

<p>where the <code>1</code> or <code>3</code> immediately follow a prior LF character (or are the first character in a file).</p>

<p>but does not match either of</p>

<pre><code>my secret code is 1234567890123456789012345
    3aklsdjlajkjvcnbxuxcjvhhkjhgtresds
</code></pre>

CC BY-SA 4.0
2019-07-16T15:22:50.080Z
2019-07-16T15:37:47.300Z
2019-07-16T15:37:47.300Z
RedGrittyBrick
<p>So in a drunken moment of genius I had forgotten about, I bought some bitcoin way back.  And I buried the address and key in some file... I was being tricky lol. That likely also led me to abandon a wallet.dat completely.
<br/></p>

<p>I'm learning to use grep to hunt it down, but the one time I know I got it to work, it returned TONS of files.
<br/></p>

<p>I know the address starts with 1F or.. f .. or D.. or d, maybe E/e lol.  But one of those.  The original parameters from stackoverflow for finding the address are:</p>

<p>[^13][a-km-zA-HJ-NP-Z1-9]{25,34}$.</p>

<p>I've attempted to adjust it to remove the 3 and have been attempting to add the first letter, but I'm trying a grep search with each and as I see no results after 20-30 minutes, I just ctrl-c the thing.
<br/>
I'm trying 
<a href="https://i.sstatic.net/WZOhb.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WZOhb.jpg" alt="yay"></a> </p>

<p>I removed the ^ and $ from the ends after when I realized that there is no reason to think it's at the beginning or end of a line (if I properly understand what that even means). <br/></p>

<p>The search area is for where I've recovered the files from these drives to, I'm hoping my "genius" drunken drive mapping attempts and subconscious file preservation impulse kept the file(s) from being overwritten.<br/></p>

<p>Any help would be very appreciated, thank you.</p>

<address><linux><recover-private-key><command-line-options>
GREP help: Bitcoin address/key buried as text somewhere on hdd
StormShadow
# GREP help: Bitcoin address/key buried as text somewhere on hdd

(Asked by: username_0 on 2019-07-15)

So in a drunken moment of genius I had forgotten about, I bought some bitcoin way back. And I buried the address and key in some file... I was being tricky lol. That likely also led me to abandon a wallet.dat completely.

I'm learning to use grep to hunt it down, but the one time I know I got it to work, it returned TONS of files.

I know the address starts with 1F or.. f .. or D.. or d, maybe E/e lol. But one of those. The original parameters from stackoverflow for finding the address are:

[^13][a-km-zA-HJ-NP-Z1-9]{25,34}$.

I've attempted to adjust it to remove the 3 and have been attempting to add the first letter, but I'm trying a grep search with each and as I see no results after 20-30 minutes, I just ctrl-c the thing.
  
I'm trying
[![yay](https://i.sstatic.net/WZOhb.jpg)](https://i.sstatic.net/WZOhb.jpg)

I removed the ^ and $ from the ends after when I realized that there is no reason to think it's at the beginning or end of a line (if I properly understand what that even means).

The search area is for where I've recovered the files from these drives to, I'm hoping my "genius" drunken drive mapping attempts and subconscious file preservation impulse kept the file(s) from being overwritten.

Any help would be very appreciated, thank you.

**Tags:** address, linux, recover-private-key, command-line-options


---

## 1 answers

### Answer by username_1 on 2019-07-16. Score: 1

> [^13][a-km-zA-HJ-NP-Z1-9]{25,34}$.

...

> **I removed the ^ and $ from the ends after when I realized that there is no reason to think it's at the beginning or end of a line ...**

As you noted, the trailing dollar sign (`$`) anchors the search expression to an end-of-line (e.g. LF on Linux) - you probably do not want to do that.

However the `[^13]` does *not* anchor the search to start of line, inside square-brackets, the caret `^` means not. So `[^13]` means look for a string whose first 8-bit character is not a `1` nor a `3`. It would match strings that begin with any other character - that is probably not what you want. If you want a string that begins with a `1` or a `3` just use `[13]`. If you wanted to anchor that to the start of a line you'd use `^[13]` not `[^13]`.

> **... (if I properly understand what that even means).**

The expression `^[13][a-zA-Z0-9]{25,34}` matches these lines:

```
1234567890123456789012345 is my secret code
3aklsdjlajkjvcnbxuxcjvhhkjhgtresds

```

where the `1` or `3` immediately follow a prior LF character (or are the first character in a file).

but does not match either of

```
my secret code is 1234567890123456789012345
    3aklsdjlajkjvcnbxuxcjvhhkjhgtresds

```


---

