original_string: function prefixQuery( $regex, $query, $prefix = NULL ) {
  		if( !isset( $prefix ) ) {
  			return $query;
  		}
  
  		if( preg_match( $regex, $query, $match ) ) {
  			$preamble = $match[1];
  			$postamble = $match[5];
  			$objectList = explode( ',', $match[3] );
  			// $prefix = $prefix . '_';
  
  			$prefixedList = '';
  
  			foreach( $objectList as $object ) {
  				if( $prefixedList !== '' ) {
  					$prefixedList .= ', ';
  				}
  
  				$prefixedList .= $prefix . trim( $object );
  			}
  
  			$query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
  		}
  
  		return $query;
  	}
code: function prefixQuery( $regex, $query, $prefix = NULL ) {
  		if( !isset( $prefix ) ) {
  			return $query;
  		}
  
  		if( preg_match( $regex, $query, $match ) ) {
  			$preamble = $match[1];
  			$postamble = $match[5];
  			$objectList = explode( ',', $match[3] );
  			// $prefix = $prefix . '_';
  
  			$prefixedList = '';
  
  			foreach( $objectList as $object ) {
  				if( $prefixedList !== '' ) {
  					$prefixedList .= ', ';
  				}
  
  				$prefixedList .= $prefix . trim( $object );
  			}
  
  			$query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
  		}
  
  		return $query;
  	}
code_tokens: function prefixQuery ( $ regex , $ query , $ prefix = NULL ) { if ( ! isset ( $ prefix ) ) { return $ query ; } if ( preg_match ( $ regex , $ query , $ match ) ) { $ preamble = $ match [ 1 ] ; $ postamble = $ match [ 5 ] ; $ objectList = explode ( ',' , $ match [ 3 ] ) ; // $prefix = $prefix . '_'; $ prefixedList = '' ; foreach ( $ objectList as $ object ) { if ( $ prefixedList !== '' ) { $ prefixedList .= ', ' ; } $ prefixedList .= $ prefix . trim ( $ object ) ; } $ query = $ preamble . ' ' . $ prefixedList . ' ' . $ postamble ; } return $ query ; }
docstring: Rebuilds the query with the prefix attached to any objects
  
  @param string $regex Regex used to add prefix
  @param string $query SQL query string
  @param string $prefix Prefix to be appended to tables, indices, etc.
  @return string Prefixed SQL query string.
docstring_tokens: Rebuilds the query with the prefix attached to any objects