vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Ignore everything between '<' and '>' and '&' and ';' using preg_replace? (https://vborg.vbsupport.ru/showthread.php?t=56717)

Link14716 09-02-2003 07:04 PM

Ignore everything between '<' and '>' and '&' and ';' using preg_replace?
 
Say I have this:
PHP Code:

        $newstring preg_replace($patterns$replacements$string); 

Now, $string may or may not have HTML tags in it, and if it does, the replacement will most likely b0rk them. So, how can I make it so that it just ignores anything between '<' and '>' and also '&' and ';'?

Also, how can I make it where it will ONLY affect things between '<' and '>' and also '&' and ';'? Thanks. :)

SmEdD 09-02-2003 07:16 PM

Take a look at this hack https://vborg.vbsupport.ru/showthrea...threadid=56589

Link14716 09-02-2003 07:20 PM

That doesn't really have anything to do with what I need.

Xenon 09-02-2003 10:17 PM

have you tried striptags() function as it's buildin in php? ^^

Link14716 09-02-2003 10:23 PM

I'm not trying to strip the tags, I want it to make it where preg_replace will not replace anything within a tag or only replace things within a tag (I need to know how to do both). That way, If I replace the letter "A" with the letter "Y", I won't have <y href="http://www.blyh.tld">, when it should still be <a href="http://www.blah.tld">. Stripping it out completely won't help much. ;)

Xenon 09-03-2003 07:27 PM

ahh sorry i missunderstood what you wanted :)

hmm, sorry can't help further, i'm really not goot in regular expr.


All times are GMT. The time now is 03:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01820 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete