Voulez Regex pour arrêter à la première occurrence de “.” et “;”

Je suis en train d'extrait de phrase, d'un paragraphe, avec des motifs comme

 Current. time is six thirty at Scotland. Past. time was five thirty at India; Current. time is five thirty at Scotland. Past. time was five thirty at Scotland. Current. time is five ten at Scotland.

Quand j'utilise les Regex comme

/current\..*scotland\./i

Cela correspond à l'ensemble de la chaîne de

Current. time is six thirty at Scotland. Past. time was six thirty at India; Current. time is five thirty at Scotland. Past. time was five thirty at Scotland. Current. time is five ten at Scotland.

Au lieu de cela, je veux arrêter à la première occurrence de "." à tous les groupes de capture comme

 Current. time is six thirty at Scotland.
 Current. time is five ten at Scotland. 

De même pour le texte comme

 Past. time was five thirty at India; Current. time is six thirty at Scotland. Past. time was five thirty at Scotland. Past. time was five ten at India;    

Lorsque J'Utilise Les Regex Comme

 /past\..*india\;/i

Ce match ensemble de la chaîne

 Past. time was five thirty at India; Current. time is six thirty at Scotland. Past. time was five thirty at Scotland. Past. time was five ten at India; 

Ici je veux capturer tous les groupes ou le premier groupe comme les suivantes, et Comment l'arrêter à la première occurrence de ";"

Past. time was five thirty at India; 
Past. time was five ten at India; 

Comment je peux faire de l'expression régulière à l'arrêt "," ou ";" avec les exemples ci-dessus?

Votre modèle est gourmand, et correspondent à autant qu'il le peut. Rendre paresseux en ajoutant un ?, de sorte qu'il ressemble /current\..*?scotland\./i.

OriginalL'auteur Pramod Shinde | 2014-06-13