original_string: public static function events_matching( $event, $rule )
  	{
  		if ( !array_key_exists( $event, static::$events ) )
  		{
  			return array();
  		}
  		
  		$callbacks = array();
  		
  		foreach( static::$events[$event] as $route => $events )
  		{
  			$rgx = "~^".str_replace( '*', '(.*)', $route )."$~";
  			if ( preg_match( $rgx, $rule ) )
  			{
  				$callbacks = array_merge( $callbacks, $events );
  			}
  		}
  		
  		return $callbacks;
  	}
code: public static function events_matching( $event, $rule )
  	{
  		if ( !array_key_exists( $event, static::$events ) )
  		{
  			return array();
  		}
  		
  		$callbacks = array();
  		
  		foreach( static::$events[$event] as $route => $events )
  		{
  			$rgx = "~^".str_replace( '*', '(.*)', $route )."$~";
  			if ( preg_match( $rgx, $rule ) )
  			{
  				$callbacks = array_merge( $callbacks, $events );
  			}
  		}
  		
  		return $callbacks;
  	}
code_tokens: public static function events_matching ( $ event , $ rule ) { if ( ! array_key_exists ( $ event , static :: $ events ) ) { return array ( ) ; } $ callbacks = array ( ) ; foreach ( static :: $ events [ $ event ] as $ route => $ events ) { $ rgx = "~^" . str_replace ( '*' , '(.*)' , $ route ) . "$~" ; if ( preg_match ( $ rgx , $ rule ) ) { $ callbacks = array_merge ( $ callbacks , $ events ) ; } } return $ callbacks ; }
docstring: Get all events matching a rule
  
  @param string		$event
  @param string 	$route
  @param mixed 		$callback
  @return void
docstring_tokens: Get all events matching a rule