 Tongela regex mpo na kobimisa bankombo na molongo oyo epesami
Motindo moko ya regex oyo ekoki kosalema mpo na kobimisa bankombo na molongo oyo epesami ezali `([AZ][az]+)`. Tala bopanzani ya maye motindo oyo esalaka : - `[AZ]` ekokani na makomi minene nyonso (kokanisaka ete lɛtrɛ ya liboso ya nkombo mokomoko ezali makomi minene). - `[az]+` ekokani na molongo nyonso ya lɛtrɛ moko to mingi ya mike. - Ba parenthèses `()` zinga zinga ya modèle mobimba esali groupe ya capture, po okoka kobimisa kombo moko na moko oyo ekokani na molongo. Na Python, ndakisa, tokoki kosalela méthode `findall` uta na module `re` mpo na koluka ba occurrences nionso ya modèle oyo na chaîne oyo epesami. Tala ndakisa ya ndenge nini okoki kosalela regex oyo mpo na kobimisa bankombo: ```python import re text = 'Jayden, Malcolm, mpe Jimmy bakendaki kelasi' # define regex pattern pattern = r'([AZ][az]+ )' # luka ba occurrences nionso ya modèle na ba kombo ya molongo oyo epesami = re.findall(modèle, texte) print(ba kombo) # ['Jayden', 'Malcolm', 'Jimmy'] ```