![]() |
Show 150 posts per page |
.dsy:it. (http://www.dsy.it/forum/)
- Tech (http://www.dsy.it/forum/forumdisplay.php?forumid=189)
-- [ESPRESSIONI REGOLARI] Perchè si pianta?!?!? (http://www.dsy.it/forum/showthread.php?threadid=18933)
[ESPRESSIONI REGOLARI] Perchè si pianta?!?!?
Ho scritto questa regex per cercare tutti i percorsi di oggetti inseriti all'interno degli attributi dei tag Html:
code:
<(\w*)\s+(\w*)\s*=\s*(""|')\s*(([.\\\/]*(\w+))+.(\w+))\s*(""|')\s+/?>
code:
<(\w*)\s+(\w*)\s*=\s*(""|')\s*([.\\\/]*(\w+).(\w+))\s*(""|')\s+/?>
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
Aggiungo che se eseguo la prima espressione su un tag singolo del tipo <img src="../Public/Images/Prova.gif" /> funziona correttamente estraendo "../Public/Images/Prova.gif", mentre se la eseguo su un file Html completo si pianta... 
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
Nessuno ha una minima idea, un suggerimento......?! 
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
Premesso che non conosco ASP.net, ma ad occhio sembrerebbe un problema di modificatore mancante.
Facendo riferimento a PHP ed alle espressioni regolari PERL compatibili, ti serve specificare l'equivalente di PCRE_DOTALL
<http://it2.php.net/manual/it/refere...n.modifiers.php>
HTH
Ti ringrazio per il consiglio, ma avevo già completamente cambiato espressione!
code:
<[^>]*\n?.*=[""']?(.*\.(jpg|jpeg|gif|png))[""']?.*\n?[^<]*>
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
| All times are GMT. The time now is 00:07. | Show all 5 posts from this thread on one page |
Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.