Find the largest contiguous prime in a string
GolfScript 40 37

.{`\`?)}+\~),\,{.,(;\{\%!}+,,1=},)\;


This looks at all numbers less than or equal to the the input, filters down to the ones that are substrings of the input, and then filters further down to the primes.  Then, it takes the largest such element (which is obviously guaranteed to have the most digits). 

Let's break it down into two main sections:

.{`\`?)}+\~,\,


This part of the code filters down to all integers string contained in the input.  It uses grave accent to turn numbers into strings, and then ? to determine the index of the substring.  Since ? returns -1 in the case of no containment, increment using ) so that the output is 0 for non-substrings, which will behave nicely with the , filtering. 

{.,(;\{\%!}+,,1=},


This part of the code filters down to the primes by counting the number of factors less than the given number (an integer is a factor only if number factor %! is 1.  A prime number will have exactly 1 factor strictly less than itself, so do 1=. 

Since the numbers are in order, take the last one and clear the stack using )\;

This obviously isn't as efficient as possible (since it somewhat unnecessarily iterates over all integers less than the input), but it still terminates with big input like 1236503 relatively quickly on my computer (1 minute).