Parse Query Parameters
Retina, 30 27 bytes

!`(?&lt;=^\1 .*[?&amp;](.*)=)[^&amp;]+


This is a full program that expects the key and the URL to be space-separated on STDIN, e.g.

action http://sub.example.com/some/dir/file.php?action=delete&amp;file=test.foo&amp;strict=true


This is essentially just a (.NET-flavoured) regex, which matches the correct value by checking that the preceding key is equal to the first string in the input (using a backreference). The only thing that's a bit odd about the regex is that .NET matches lookbehinds from right to left, which is why the "backreference" actually references a group that appears later in the pattern. The !` instructs Retina to print the actual match (if there is one) instead of the number of matches.

For those who don't regex, here is an annotated version. Read the lookbehind from the bottom up, because that's how it's processed:

(?&lt;=        # A lookbehind. Everything we match in here will not be returned as part of
            # actual match. Start reading this from the corresponding parenthesis.
  ^         # Ensure we're at the beginning of the input, so that we've checked
            # against the entire input key.
  \1        # Backreference to the key to check that it's the one we've asked for.
  [ ]       # Match a space.
  .*        # Consume the rest of the URL.
  [?&amp;]      # Match a ? or a &amp; to ensure we've actually captured the entire key.
  (         # End of group 1.
    .+      # Match the key.
  )         # Capturing group 1. Use this to keep track of the key.
  =         # Make sure we start right after a '='
)           # Start reading the lookbehind here.
[^&amp;]+       # Match the value, i.e. as many non-&amp; characters as possible.