Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 37863)
+++ src/wp-includes/media.php	(working copy)
@@ -1458,7 +1458,32 @@
 function img_caption_shortcode( $attr, $content = null ) {
 	// New-style shortcode with the caption inside the shortcode with the link and image tags.
 	if ( ! isset( $attr['caption'] ) ) {
-		if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
+		$matches = array();
+		$regex = '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is';
+		preg_match( $regex, $content, $matches );
+
+		/**
+		 * Filter the content and caption for use in the caption shortcode.
+		 *
+		 * If the filtered array `$matches` is empty, an old-style caption attribute
+		 * will be assumed.
+		 *
+		 * @since x.x.x
+		 *
+		 * @param array $matches	The default result of `preg_match`.
+		 * @param string $content	The content included in the caption shortcode (including the image).
+		 * @param string $regex		The regular expression capturing the image and the caption attribute.
+		 *
+		 * @return array $matches {
+		 * 		Array corresponding to the result of `preg_match`.
+		 *
+		 * 		@type string 1	The new `$content` used in the shortcode (i.e. the `<img>` tag).
+		 * 		@type string 2	The caption (set as `$attr['caption']`.
+		 * }
+		 */
+		$matches = apply_filters( 'img_caption_shortcode_content', $matches, $content, $regex );
+
+		if ( ! empty ( $matches ) ) {
 			$content = $matches[1];
 			$attr['caption'] = trim( $matches[2] );
 		}
