RegExp pattern to scan for NO HTML tags - need help

From: Phil Powell (soazine_at_erols.com)
Date: 01/29/04


Date: 29 Jan 2004 11:21:23 -0800

I am having to use an existing FormValidator class to check form
elements, and one of the things I must check is to see if someone
entered tags in the string <>; if so, it must flag for that.

However, the catch is that, the way FormValidator class is written, I
can't use this pattern:

/<[^>]+>/

because it needs to check for the pattern of the NEGATION of that for
FormValidator class to work. In other words, it must match the pattern
something like this:

! /<[^>]+>/

But the only way I can do this is to create a pattern and nothing
more; no other code of any kind except the literal pattern formed in
such a way to check for everything BUT a tag!

I also cannot use str_replace and strip out the tags; I can't use
htmlentities and translate the tags.. the requirements are to FLAG the
user if a tag is found but by NOT using the pattern to find one, but
to ONLY use the pattern to find the NEGATION of finding one!!!

Mind bender, I know.

HELP!

Phil



Relevant Pages

  • RegExp pattern to scan for NO HTML tags - need help
    ... However, the catch is that, the way FormValidator class is written, I ... can't use this pattern: ... I also cannot use str_replace and strip out the tags; ... to ONLY use the pattern to find the NEGATION of finding one!!! ...
    (comp.lang.php)
  • Re: RegExp pattern to scan for NO HTML tags - need help
    ... >>However, the catch is that, the way FormValidator class is written, I ... it must match the pattern ... >>to ONLY use the pattern to find the NEGATION of finding one!!! ... > them, then zero or more chars, then a '>'. ...
    (alt.php)
  • Re: RegExp pattern to scan for NO HTML tags - need help
    ... >>However, the catch is that, the way FormValidator class is written, I ... it must match the pattern ... >>to ONLY use the pattern to find the NEGATION of finding one!!! ... > them, then zero or more chars, then a '>'. ...
    (comp.lang.php)
  • How to change text inside an HTML tag?
    ... I've got a database full of raw dumps from MySQL ... Using tags won't work, due to other complications with the way ... It would be outstanding if I could just add another find pattern ...
    (comp.lang.php)
  • Re: RegExp pattern to scan for NO HTML tags - need help
    ... >However, the catch is that, the way FormValidator class is written, I ... >can't use this pattern: ... >such a way to check for everything BUT a tag! ... >to ONLY use the pattern to find the NEGATION of finding one!!! ...
    (alt.php)