original_string: public static function CreditCard ($value, $options) {
  		//
  		$number_pattern_list	= [
  			'American Express'	=> [
  				"/^34[0-9]{13}$/",
  				"/^37[0-9]{13}$/",
  			],
  			'China UnionPay'	=> [
  				"/^62212[6-9][0-9]{10}$/",
  				"/^6221[3-9][0-9][0-9]{10}$/",
  				"/^622[2-8] [0-9]{12}$/",
  				"/^6229[01][0-9][0-9]{10}$/",
  				"/^62292[0-5][0-9]{10}$/",
  				"/^62[4-6][0-9]{13}$/",
  				"/^628[2-8][0-9]{12}$/",
  			],
  			'Diners Club International'	=> [
  				"/^300[0-9]{11}$/",
  				"/^305[0-9]{11}$/",
  				"/^3095[0-9]{10}$/",
  				"/^36[0-9]{11}$/",
  				"/^3[89][0-9]{12}$/",
  			],
  			'Discover Card'	=> [
  				"/^60110[0-9]{11}$/",
  				"/^6011[2-4][0-9]{11}$/",
  				"/^60117[4-9][0-9]{10}$/",
  				"/^60118[6-9][0-9]{10}$/",
  				"/^60119[0-9][0-9]{10}$/",
  				"/^64[4-9][0-9]{13}$/",
  				"/^65[0-9]{14}$/",
  			],
  			'JCB'	=> [
  				"/^352[89][0-9]{12}$/",
  				"/^35[3-7][0-9]{12}$/",
  				"/^358[1-9][0-9]{12}$/",
  			],
  			'MasterCard'	=> [
  				"/^5[0-9]{15}$/",
  			],
  			'UATP'			=> [
  				"/^1[0-9]{14}$/",
  			],
  			'Visa'			=> [
  				"/^4[0-9]{13}(?:[0-9]{3})?$/",
  			],
  		];
  
  		foreach ($number_pattern_list as $card_name => $pattern_list) {
  			foreach ($pattern_list as $pattern) {
  				if (1 === preg_match($pattern, $value)) {
  					//チェックディジット
  					for ($i = 0, $value = strrev($value), $alt = true, $total = 0; ($str = substr($value, $i, 1)) !== false;$total += $alt ? $str : ($str < 5 ? $str * 2 : 1 + ($str - 5) * 2), $alt = !$alt, $i++);
  					return $total % 10 === 0;
  				}
  			}
  		}
  
  		return false;
  	}
code: public static function CreditCard ($value, $options) {
  		//
  		$number_pattern_list	= [
  			'American Express'	=> [
  				"/^34[0-9]{13}$/",
  				"/^37[0-9]{13}$/",
  			],
  			'China UnionPay'	=> [
  				"/^62212[6-9][0-9]{10}$/",
  				"/^6221[3-9][0-9][0-9]{10}$/",
  				"/^622[2-8] [0-9]{12}$/",
  				"/^6229[01][0-9][0-9]{10}$/",
  				"/^62292[0-5][0-9]{10}$/",
  				"/^62[4-6][0-9]{13}$/",
  				"/^628[2-8][0-9]{12}$/",
  			],
  			'Diners Club International'	=> [
  				"/^300[0-9]{11}$/",
  				"/^305[0-9]{11}$/",
  				"/^3095[0-9]{10}$/",
  				"/^36[0-9]{11}$/",
  				"/^3[89][0-9]{12}$/",
  			],
  			'Discover Card'	=> [
  				"/^60110[0-9]{11}$/",
  				"/^6011[2-4][0-9]{11}$/",
  				"/^60117[4-9][0-9]{10}$/",
  				"/^60118[6-9][0-9]{10}$/",
  				"/^60119[0-9][0-9]{10}$/",
  				"/^64[4-9][0-9]{13}$/",
  				"/^65[0-9]{14}$/",
  			],
  			'JCB'	=> [
  				"/^352[89][0-9]{12}$/",
  				"/^35[3-7][0-9]{12}$/",
  				"/^358[1-9][0-9]{12}$/",
  			],
  			'MasterCard'	=> [
  				"/^5[0-9]{15}$/",
  			],
  			'UATP'			=> [
  				"/^1[0-9]{14}$/",
  			],
  			'Visa'			=> [
  				"/^4[0-9]{13}(?:[0-9]{3})?$/",
  			],
  		];
  
  		foreach ($number_pattern_list as $card_name => $pattern_list) {
  			foreach ($pattern_list as $pattern) {
  				if (1 === preg_match($pattern, $value)) {
  					//チェックディジット
  					for ($i = 0, $value = strrev($value), $alt = true, $total = 0; ($str = substr($value, $i, 1)) !== false;$total += $alt ? $str : ($str < 5 ? $str * 2 : 1 + ($str - 5) * 2), $alt = !$alt, $i++);
  					return $total % 10 === 0;
  				}
  			}
  		}
  
  		return false;
  	}
code_tokens: public static function CreditCard ( $ value , $ options ) { // $ number_pattern_list = [ 'American Express' => [ "/^34[0-9]{13}$/" , "/^37[0-9]{13}$/" , ] , 'China UnionPay' => [ "/^62212[6-9][0-9]{10}$/" , "/^6221[3-9][0-9][0-9]{10}$/" , "/^622[2-8] [0-9]{12}$/" , "/^6229[01][0-9][0-9]{10}$/" , "/^62292[0-5][0-9]{10}$/" , "/^62[4-6][0-9]{13}$/" , "/^628[2-8][0-9]{12}$/" , ] , 'Diners Club International' => [ "/^300[0-9]{11}$/" , "/^305[0-9]{11}$/" , "/^3095[0-9]{10}$/" , "/^36[0-9]{11}$/" , "/^3[89][0-9]{12}$/" , ] , 'Discover Card' => [ "/^60110[0-9]{11}$/" , "/^6011[2-4][0-9]{11}$/" , "/^60117[4-9][0-9]{10}$/" , "/^60118[6-9][0-9]{10}$/" , "/^60119[0-9][0-9]{10}$/" , "/^64[4-9][0-9]{13}$/" , "/^65[0-9]{14}$/" , ] , 'JCB' => [ "/^352[89][0-9]{12}$/" , "/^35[3-7][0-9]{12}$/" , "/^358[1-9][0-9]{12}$/" , ] , 'MasterCard' => [ "/^5[0-9]{15}$/" , ] , 'UATP' => [ "/^1[0-9]{14}$/" , ] , 'Visa' => [ "/^4[0-9]{13}(?:[0-9]{3})?$/" , ] , ] ; foreach ( $ number_pattern_list as $ card_name => $ pattern_list ) { foreach ( $ pattern_list as $ pattern ) { if ( 1 === preg_match ( $ pattern , $ value ) ) { //チェックディジット for ( $ i = 0 , $ value = strrev ( $ value ) , $ alt = true , $ total = 0 ; ( $ str = substr ( $ value , $ i , 1 ) ) !== false ; $ total += $ alt ? $ str : ( $ str < 5 ? $ str * 2 : 1 + ( $ str - 5 ) * 2 ) , $ alt = ! $ alt , $ i ++ ) ; return $ total % 10 === 0 ; } } } return false ; }
docstring: Credit card check
docstring_tokens: Credit card check