--- media.php.orig	2015-09-16 08:03:30.000000000 +0200
+++ media.php	2015-09-22 18:50:53.000000000 +0200
@@ -859,7 +859,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 4.4.0
+		 * 
+		 * @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] );
 		}
