Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.regexp > #250
| From | Olivier Miakinen <om+news@miakinen.net> |
|---|---|
| Newsgroups | fr.comp.lang.regexp |
| Subject | Re: Trouver le premier = (Il y avait longtemps !) |
| Date | 2025-10-02 15:48 +0200 |
| Organization | There's no cabale |
| Message-ID | <10blvsb$300c$1@cabale.usenet-fr.net> (permalink) |
| References | <h4vsdk1blivm4qanrojpdkcqraqgntnon3@4ax.com> |
Le 02/10/2025 à 15:38, Otomatic a écrit :
>
> preg_match_all("~^Define: (.+)=(.+)~m",$output, $matches)
>
> [...]
>
> Comment faire pour que ce soit le premier signe = et non pas le dernier
> qui soit pris en compte ?
[non testé]
Remplacer le premier .+ par .+? :
preg_match_all("~^Define: (.+?)=(.+)~m",$output, $matches)
Mot-clé : greedy
Back to fr.comp.lang.regexp | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Trouver le premier = (Il y avait longtemps !) Otomatic <otomatic@oto.invalid> - 2025-10-02 15:38 +0200
Re: Trouver le premier = (Il y avait longtemps !) Olivier Miakinen <om+news@miakinen.net> - 2025-10-02 15:48 +0200
Re: Trouver le premier = (Il y avait longtemps !) Otomatic <otomatic@oto.invalid> - 2025-10-03 09:18 +0200
csiph-web