 |
|  |
 |
ripe |
| [ESPRESSIONI REGOLARI] Perchè si pianta?!?!? |
16-04-2005 18:58 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
[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+/?>
Quando la eseguo mi entra in un ciclo infinito e non riesce a portare a termine il compito.
Se invece la modifico per cercare solo oggetti con percorso semplice funziona:
code:
<(\w*)\s+(\w*)\s*=\s*(""|')\s*([.\\\/]*(\w+).(\w+))\s*(""|')\s+/?>
Chi mi sa spiegare il perchè?!
Ah, il motore delle Regex è quello di Asp.Net!
Grazieeeeee
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
|
|
16-04-2005 18:58 |
|
|
|  |
 |
ripe |
| Aggiungo che se eseguo la prima espressione su un ... |
16-04-2005 19:08 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
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!»
|
|
16-04-2005 19:08 |
|
|
|  |
 |
ripe |
| Nessuno ha una minima idea, un suggerimento......? ... |
17-04-2005 09:46 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
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!»
|
|
17-04-2005 09:46 |
|
|
|  |
 |
Gusher |
| Premesso che non conosco ASP.net, ma ad occhio sem ... |
17-04-2005 11:14 |
|
 |
Gusher |
Splinter fun club

Registered: Jan 2003
Posts: 475 (0.06 al dì)
Location: Ovunque
Corso: Informatica
Anno: Done
Time Online: 15 Days, 22:06:15 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
|
17-04-2005 11:14 |
|
|
|  |
 |
ripe |
| Ti ringrazio per il consiglio, ma avevo già compl ... |
17-04-2005 12:08 |
|
 |
ripe |
- up in the mountains -

Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline
Edit | Report | IP: Logged |
Ti ringrazio per il consiglio, ma avevo già completamente cambiato espressione!
code: <[^>]*\n?.*=[""']?(.*\.(jpg|jpeg|gif|png))[""']?.*\n?[^<]*>
In questo modo isolo solo le immagini! 
Ciaoooooo
Ale
__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»
|
|
17-04-2005 12:08 |
|
|
|  |
 |
| All times are GMT. The time now is 00:50. |
|
|
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|