Are you asking for a method to going about doing this using a programming language or an algorithm you could implement?
Assuming you had a string containing the digits of Euler's Number you could use a built in function like the following:
(In Java) :
(In C++) : https://stackoverflow.com/questions/13195353/how-to-find-substring-from-string
If you want an algorithm the simplest I could think of would be to go through the string of digits from start to end looking for the start of your sequence. Once you find it, say "3" in your example, you would check to see if the next five digits are "51814". If not, then start from the next character after that "3" (you could optimize this) and look for the next "3" to try again.