import re
    

def clean(texte):
    regex = r"\[\[[^]]+\]\]|\w+"
    s_tab = []
    res = re.findall(regex, texte)
    for i in range(len(res)):
        if len(res[i]) >= 4:
            s = res[i]
            if "[" not in s:
                s.lower()
            s_tab.append(s)
    res = ' '.join(s_tab)
    return res
    
s1 = "[[Fichier:Euclid flowchart 1.png|vignette|[[Flowchart]] of an algorithm ([[Euclid's algorithm]]).]]"
s2 = "blablablabla this \" is  \' \' (yes) not a link. This is a link [[Al-Andalus|andalou]] and this [[Babylone|Babyloniens]] is a link with a pipe in it."
print(clean(s1+s2))