Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.regexp > #82
| From | Olivier Miakinen <om+news@miakinen.net> |
|---|---|
| Newsgroups | fr.comp.lang.regexp |
| Subject | Re: Help with RexExp in English? |
| Date | 2017-06-11 12:55 +0200 |
| Organization | There's no cabale |
| Message-ID | <ohj7jt$11e9$1@cabale.usenet-fr.net> (permalink) |
| References | <ohhfer$vv5$1@solani.org> <5397fb215ea33b88eb24619edfcc25169f1a0659@news.nemoweb.net> <ohj5ai$ttk$1@solani.org> |
Bonjour, Le 11/06/2017 12:16, Heinz Kesting a écrit : > Hi, >> >> This could be a first step : >> <https://www.google.fr/?gws_rd=ssl#q=english+regexp+forum> >> > > Thanks for this, but I'd prefer to find a forum in a newsreader, like > thunderbird, not in a web interface with all its adverts and distractions. > > Could you be so kind and allow here an exception for me in English, please? Je veux bien lire ton anglais, mais accepte de recevoir les réponses en français. > I am looking for a RegExp that would match the following pattern: > > [Any alphanumeric text][<a href="][Any alphanumeric text][<a href="][Any > alphanumeric text][<a/>] « alphanumeric » = [a-zA-Z0-9] Je suppose que ce n'est pas ce que tu veux car le code HTML ne serait même pas bien formé. > I need this for a text which is intended to be displayed later in a > web-like editor with hyperlinks. > I'd like to make sure that the hyperlinks are correctly inserted, before > the text goes into the web display. So the following pattern would be OK > and must not be a match: > > [Any alphanumeric text][<a href="][Any alphanumeric text][<a/>][Any > alphanumeric text][<a href="][Any alphanumeric text][<a/>] Ah, en fait ce que tu veux c'est : [<a href="][Any text *but* <a/>][a href="] Sauf que le <a/> est sûrement une erreur. Donc : [<a href="][Any text *but* </a>][a href="] > I tried patterns like '<a href=.+?^[<a/>].+?<a href=.+?</a>' > which was intended to work like: > > '<a href=' not being followed by '<a/>' but 'any alphanumeric text' and > a second '<a href=">' 1) Ne pas confondre </a> avec <a/> 2) ^ en dehors des [] signifie « début de ligne » et pas « exclure » 3) [<a/>] prend un seul caractère qui est soit un <, soit un a, soit un /, soit un >. C'est équivalent à [/<>a]. > in other words if '<a href=' is not followed by '</a>' but a second '<a > href=' that's faulty and must be matched and reported for correction. Bon, là c'est clair. http://php.net/manual/en/regexp.reference.assertions.php Donc : '<a href=((?!</a>).)*<a href=' Ou plus simplement : '<a ((?!</a>).)*<a ' > Hope I could explain well enough ... Hope you can use Google translation or something like that. -- Olivier Miakinen
Back to fr.comp.lang.regexp | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help with RexExp in English? Heinz Kesting <Nobody@invalid.invalid> - 2017-06-10 20:57 +0200
Re: Help with RexExp in English? Duzz' <jsuis@jreste.invalid> - 2017-06-10 20:42 +0000
Re: Help with RexExp in English? Heinz Kesting <Nobody@invalid.invalid> - 2017-06-11 12:16 +0200
Re: Help with RexExp in English? Olivier Miakinen <om+news@miakinen.net> - 2017-06-11 12:55 +0200
Re: Help with RexExp in English? Heinz Kesting <Nobody@invalid.invalid> - 2017-06-11 23:21 +0200
Re: Help with RexExp in English? Olivier Miakinen <om+news@miakinen.net> - 2017-06-12 00:36 +0200
Re: Help with RexExp in English? Heinz Kesting <Nobody@invalid.invalid> - 2017-06-16 00:08 +0200
Re: Help with RexExp in English? Olivier Miakinen <om+news@miakinen.net> - 2017-06-16 01:10 +0200
Re: Help with RexExp in English? Heinz Kesting <Nobody@invalid.invalid> - 2017-06-18 12:14 +0200
Re: Help with RexExp in English? Olivier Miakinen <om+news@miakinen.net> - 2017-06-18 19:05 +0200
Re: Help with RexExp in English? Logan Won-Ki Lee <logan.wonki.lee@gmail.com> - 2021-07-14 12:19 +1000
Re: Help with RexExp in English? Olivier Miakinen <om+news@miakinen.net> - 2021-07-14 09:23 +0200
Re: Help with RexExp in English? Otomatic <otomatic@oto.invalid> - 2021-07-14 17:09 +0200
csiph-web