PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Ignore Tags
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Ignore Tags

Réponse
 
LinkBack Outils de la discussion
Vieux 12/05/2008, 05h25   #1
Jorge Peña
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Ignore Tags

Hello. I am writing a script that scans some content for email addresses and
then encrypts them in a way to hide them from spam bots (For more
information, http://mailhide.recaptcha.net/ ). The Regular Expressions work
perfectly fine, I look for plain email addresses as well as hyperlink email
addresses (<a href="mailto:email@blah.com"> and <a href="email@blah.com">).
I am nearly done writing the script, the last requested feature is to have
some sort of tags or way of making it so that the emails within these tags
don't get encrypted. So for example the email within
[nomailhide]haha@blah.com[/nomailhide] won't get encrypted. I know how to
scan for the nomailhide tags and get its contents, I just can't figure out
how to make it so that the callbacks that encrypt the emails don't touch, or
ignore, the emails within the nomailhide tags. Perhaps I'm over complicating
things, but I've already asked people in regex and php IRC channels and they
too can't figure it out. I've spent 5 hours or so on this one problem and I
think my head's about to explode so I'm going to leave it for a while.

I would REALLY appreciate it if anyone could please me out with this in
any way possible, I would really value your time. Please, someone, I'm so
desperate. If my message isn't really descriptive or anything please let me
know, it's just that I'm so sick and tired of all of this.

  Réponse avec citation
Vieux 12/05/2008, 05h27   #2
Jorge Peña
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ignore Tags

Just to show how exhausted I am: I forgot to provide a link to the relevant
source code. Here it is: http://paste.blaenkdenum.com/351

On Sun, May 11, 2008 at 9:25 PM, Jorge Peña <jorgepblank@gmail.com> wrote:

> Hello. I am writing a script that scans some content for email addresses
> and then encrypts them in a way to hide them from spam bots (For more
> information, http://mailhide.recaptcha.net/ ). The Regular Expressions
> work perfectly fine, I look for plain email addresses as well as hyperlink
> email addresses (<a href="mailto:email@blah.com"> and <a href="
> email@blah.com">). I am nearly done writing the script, the last requested
> feature is to have some sort of tags or way of making it so that the emails
> within these tags don't get encrypted. So for example the email within
> [nomailhide]haha@blah.com[/nomailhide] won't get encrypted. I know how to
> scan for the nomailhide tags and get its contents, I just can't figure out
> how to make it so that the callbacks that encrypt the emails don't touch,or
> ignore, the emails within the nomailhide tags. Perhaps I'm over complicating
> things, but I've already asked people in regex and php IRC channels and they
> too can't figure it out. I've spent 5 hours or so on this one problem andI
> think my head's about to explode so I'm going to leave it for a while.
>
> I would REALLY appreciate it if anyone could please me out with this
> in any way possible, I would really value your time. Please, someone, I'mso
> desperate. If my message isn't really descriptive or anything please let me
> know, it's just that I'm so sick and tired of all of this.
>


  Réponse avec citation
Vieux 12/05/2008, 05h50   #3
Adam Richardson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: [PHP] Re: Ignore Tags

I didn't check out your source, but in terms of a regex that only matches
items not surrounded by some special tag, what about negative lookaheads and
lookbehinds, like:

(?<!\[specialtag\])REST_OF_YOUR_REGEX(?!\[specialtag\])

I've not used them in PHP, but just a quick thought that might .

You can read more at the site below:
http://www.regular-expressions.info/lookaround.html

Adam

-----Original Message-----
From: Jorge Peña <jorgepblank@gmail.com> [mailto:=?ISO-8859-1?Q?
Jorge_Pe=F1a _<jorgepblank@gmail.com>?=]
Sent: Monday, May 12, 2008 12:27 AM
To: php-general@lists.php.net
Subject: [php] Re: Ignore Tags

Just to show how exhausted I am: I forgot to provide a link to the relevant
source code. Here it is: http://paste.blaenkdenum.com/351

On Sun, May 11, 2008 at 9:25 PM, Jorge Peña <jorgepblank@gmail.com> wrote:

> Hello. I am writing a script that scans some content for email addresses
> and then encrypts them in a way to hide them from spam bots (For more
> information, http://mailhide.recaptcha.net/ ). The Regular Expressions
> work perfectly fine, I look for plain email addresses as well as hyperlink
> email addresses (<a href="mailto:email@blah.com"> and <a href="
> email@blah.com">). I am nearly done writing the script, the last requested
> feature is to have some sort of tags or way of making it so that the

emails
> within these tags don't get encrypted. So for example the email within
> [nomailhide]haha@blah.com[/nomailhide] won't get encrypted. I know how to
> scan for the nomailhide tags and get its contents, I just can't figure out
> how to make it so that the callbacks that encrypt the emails don't touch,

or
> ignore, the emails within the nomailhide tags. Perhaps I'm over

complicating
> things, but I've already asked people in regex and php IRC channels and

they
> too can't figure it out. I've spent 5 hours or so on this one problem and

I
> think my head's about to explode so I'm going to leave it for a while.
>
> I would REALLY appreciate it if anyone could please me out with this
> in any way possible, I would really value your time. Please, someone, I'm

so
> desperate. If my message isn't really descriptive or anything please let

me
> know, it's just that I'm so sick and tired of all of this.
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h18.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10379 seconds with 11 queries