diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/View/Compilers/BladeCompiler.php
+++ b/src/Illuminate/View/Compilers/BladeCompiler.php
@@ -159,7 +159,7 @@ class BladeCompiler extends Compiler implements CompilerInterface {
 	 */
 	protected function compileOpenings($value)
 	{
-		$pattern = '/(?<!\w)(\s*)@(if|elseif|foreach|for|while)(\s*\(.*\))/';
+		$pattern = '/(?(R)\((?:[^\(\)]|(?R))*\)|(?<!\w)(\s*)@(if|elseif|foreach|for|while)(\s*(?R)+))/';
 
 		return preg_replace($pattern, '$1<?php $2$3: ?>', $value);
 	}
Added support for nesting parenthesis on Blade expressions (recursive RegEx parsing).