Print Page | Close Window

RegEX - Corrected / clearer explanation

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=1419
Printed Date: 13 March 2025 at 4:05pm


Topic: RegEX - Corrected / clearer explanation
Posted By: Desperado
Subject: RegEX - Corrected / clearer explanation
Date Posted: 18 July 2003 at 10:08am
All,
 
I am posting this because I was asked a question, by email, on my explanation that I posted earlier.  I realized that, reading my own post, it was unclear and or even in error.  I will attempt to correct that here.  If anyone out there sees an error in this posting PLEASE correct me.
 
I see where there is some  confusion and I see where my explanations fall short.  But let me again remark .... I am no expert on regular expressions but doing a lot of Perl programming has forced me into being able to use them somewhat, sorta, ok.  I make mistakes, like anyone.
 
 Questions on the RegEx below
 
<[!--]+[\x20]{0,1}[a-zA-Z0-9](10,)[\x20](0,1)[!--]) 
 
 
The expression [!--]  Very easy to see the confusion ...  This means to look for a SINGLE character from Bang (!) to Dash (-).  This is not looking for the literal "!--".  So, I am trying to detect the opening tag "<" followed by any one of the following 13 characters: ! " # $ % & ' ( ) * + , -  The Bang Dash Dash happens to fit that because the first char is a ! .  If we want to detect "!--"  the expression would be (!\-\-).  Be careful here .... [!\-\-] won't work for that and actually is redundant.  That expression looks for Bang OR dash OR dash where if the expression is enclosed in () it looks for the exact "phrase".
 
Regards,
 
Dan S.
 



Replies:
Posted By: Guests
Date Posted: 20 July 2003 at 5:40am

Thank you!

I had the idea (but my English is to poor) to make the same remark (but shorter).

Gaby




Print Page | Close Window