Write a function 

```python
vowel_2_index```

that takes in a string and replaces all the vowels [a,e,i,o,u] with their respective positions within that string. 
E.g: 

```python
vowel_2_index('this is my string') == 'th3s 6s my str15ng'
vowel_2_index('Codewars is the best site in the world') == 'C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld'
vowel_2_index('') == ''
```
 Your function should be case insensitive to the vowels.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def vowel_2_index(string):
	

Solutions:
def vowel_2_index(string):
	vowels = 'aeiouAEIOU'
	return ''.join((x if x not in vowels else str(n + 1) for (n, x) in enumerate(string)))


import re

def vowel_2_index(string):
	return re.sub('[aeiou]', lambda m: str(m.end()), string, 0, re.I)


def vowel_2_index(string):
	vowels = frozenset('aeiouAEIOU')
	return ''.join([str(i + 1) if c in vowels else c for (i, c) in enumerate(string)])


def vowel_2_index(string):
	return ''.join([str(i + 1) if x.lower() in 'aeiou' else x for (i, x) in enumerate(string)])


vowel_2_index = lambda s: ''.join((str(i) if e in 'aiueoAIUEO' else e for (i, e) in enumerate(s, 1)))


def vowel_2_index(string):
	vowels = 'aeiouAEIOU'
	return ''.join((str(i) if v in vowels else v for (i, v) in enumerate(string, 1)))


def vowel_2_index(s):
	return ''.join((str(i + 1) if s[i].lower() in 'aeuoi' else s[i] for i in range(len(s))))


def vowel_2_index(string):
	return ''.join([str(c + 1) if l.lower() in 'aeiou' else l for (c, l) in enumerate(string)])


def vowel_2_index(string):
	return ''.join((c if c not in 'aeiouAEIOU' else str(i + 1) for (i, c) in enumerate(string)))


import re

def vowel_2_index(string):
	return re.sub('[aeiou]', lambda m: str(m.start(0) + 1), string, flags=re.IGNORECASE)


def vowel_2_index(string):
	return ''.join([str(i + 1) if string[i].lower() in 'aeiou' else string[i] for i in range(len(string))])


vowel_2_index = lambda s: ''.join([str(i + 1) if x.lower() in 'aeiou' else x for (i, x) in enumerate(s)])


import re

def vowel_2_index(string):
	return re.sub(re.compile('[euioa]', re.I), lambda match: str(match.start() + 1), string)


def vowel_2_index(string):
	ret = ''
	for i in range(len(string)):
		if string[i] in 'aeiouAEIOU':
			ret = ret + str(i + 1)
		else:
			ret = ret + string[i]
	return ret


VOWELS = {'a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U'}

def vowel_2_index(string):
	return ''.join((str(i) if a in VOWELS else a for (i, a) in enumerate(string, start=1)))


import re

def vowel_2_index(string):
	pattern = re.compile('([aeiouAEIOU])')
	for i in re.finditer(pattern, string):
		s = str(i.start() + 1)
		string = string.replace(i.group(), s, 1)
	return string


def vowel_2_index(str_to_switch):
	result = ''
	vowels = 'aeiouAEIOU'
	for (index, ch) in enumerate(str_to_switch):
		if ch in vowels:
			result += str(index + 1)
		else:
			result += ch
	return result


def vowel_2_index(s):
	vowels = 'aeiouAEIOU'
	returnStr = ''
	for i in range(len(s)):
		if s[i] in vowels:
			returnStr += str(i + 1)
		else:
			returnStr += s[i]
	return returnStr


def vowel_2_index(string):
	vowels = 'aAeEiIoOuU'
	r = []
	for (i, item) in enumerate(string, 1):
		if item not in vowels:
			r.append(item)
		else:
			r.append(str(i))
	return ''.join(r)