How can I write a regex that will extract "père" and "Tomy" from the following texts?
myText = "Qui est le père de Tomy?";
myText = "Qui est le père aimé du Jeune Tomy?";
myText = "Qui est le père du petit de Tomy";
How can I write a regex that will extract "père" and "Tomy" from the following texts?
myText = "Qui est le père de Tomy?";
myText = "Qui est le père aimé du Jeune Tomy?";
myText = "Qui est le père du petit de Tomy";
You can use this regex.
père{1}|Tomy{1}
And to prevent multiple use of theses words in your sentences, you can also use
père+|Tomy+