Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.regexp > #250
| Path | csiph.com!pasdenom.info!usenet-fr.net!.POSTED!not-for-mail |
|---|---|
| From | Olivier Miakinen <om+news@miakinen.net> |
| Newsgroups | fr.comp.lang.regexp |
| Subject | Re: Trouver le premier = (Il y avait longtemps !) |
| Date | Thu, 2 Oct 2025 15:48:59 +0200 |
| Organization | There's no cabale |
| Lines | 14 |
| Message-ID | <10blvsb$300c$1@cabale.usenet-fr.net> (permalink) |
| References | <h4vsdk1blivm4qanrojpdkcqraqgntnon3@4ax.com> |
| NNTP-Posting-Host | 2a02-8424-7701-5901-977d-6328-825c-2400.rev.sfr.net |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | cabale.usenet-fr.net 1759412939 98316 2a02:8424:7701:5901:977d:6328:825c:2400 (2 Oct 2025 13:48:59 GMT) |
| X-Complaints-To | abuse@usenet-fr.net |
| NNTP-Posting-Date | Thu, 2 Oct 2025 13:48:59 +0000 (UTC) |
| User-Agent | Betterbird (Linux) |
| Content-Language | en-US |
| Cancel-Lock | sha256:RBJ8ZsgqBnW/tYT/qu1JcXK8SA2O9g+qJLDzRY5h1cg= |
| Cancel-Key | sha256:f0rHwfZXp5iKFjTbX/I5bQXh9Dta33nWBzLi8f9oaoM= |
| In-Reply-To | <h4vsdk1blivm4qanrojpdkcqraqgntnon3@4ax.com> |
| Xref | csiph.com fr.comp.lang.regexp:250 |
Show key headers only | View raw
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