Basic regex tasks. Write a function that takes in a numeric code of any length. The function should check if the code begins with 1, 2, or 3 and return `true` if so. Return `false` otherwise. 

You can assume the input will always be a number.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def validate_code(code):
	

Solutions:
def validate_code(code):
	return str(code).startswith(('1', '2', '3'))


def validate_code(code):
	return str(code)[0] in '123'


def validate_code(code):
	import re
	return bool(re.match('^[123]\\d*$', str(code)))


def validate_code(code):
	return int(str(code)[0]) < 4


import re

def validate_code(code):
	return bool(re.match('^[1-3]', str(code)))


validate_code = lambda c: str(c)[0] in '123'


def validate_code(code):
	return True if str(code)[0] in set('123') else False


from re import match
from math import log10

def validate_code(code):
	return 0 < code // 10 ** int(log10(code)) < 4
	return bool(match('\\A[1-3]', str(code)))


validate_code = lambda n: str(n).startswith(tuple('123'))


def validate_code(code):
	import re
	return True if re.match('^1|^2|^3', str(code)) is not None else False


import re

def validate_code(code):
	return bool(re.match('[123]{1}.*', str(code)))


def validate_code(code):
	return True if str(code)[0] in ('1', '2', '3') else False


import re
validate_code = lambda c: bool(re.search('^[1-3]', str(c)))


from math import ceil, log10

def validate_code(code):
	return first_digit(code) in (1, 2, 3)

def first_digit(num):
	num_of_digs = ceil(log10(num))
	amount_of_digs_to_remove = num_of_digs - 1
	return num // 10 ** amount_of_digs_to_remove


import re

def validate_code(code):
	if re.search('(\\A1)|(\\A2)|(\\A3)', str(code)):
		return True
	return False


def validate_code(code):
	return '1' <= str(code)[0] <= '3'


def validate_code(code):
	code = list(map(int, list(str(code))))
	return True if code[0] == 1 or code[0] == 2 or code[0] == 3 else False


def validate_code(code):
	code_str = str(code)
	if code_str[0] == '1' or code_str[0] == '2' or code_str[0] == '3':
		return True
	return False


def validate_code(code):
	wert = str(code)
	print(wert)
	if wert[0] == '1':
		return True
	elif wert[0] == '2':
		return True
	elif wert[0] == '3':
		return True
	else:
		return False