Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [ESPRESSIONI REGOLARI] Perchè si pianta?!?!?
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gusher
Splinter fun club

User info:
Registered: Jan 2003
Posts: 475 (0.06 al dì)
Location: Ovunque
Corso: Informatica
Anno: Done
Time Online: 15 Days, 22:06:15 [...]
Status: Offline

Post actions:

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
Click Here to See the Profile for Gusher Click Here to See the Blog of Gusher Click here to Send Gusher a Private Message Find more posts by Gusher Add Gusher to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
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

Post actions:

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
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 00:50.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

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
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.056 seconds (52.30% PHP - 47.70% MySQL) con 25 query.