Jump to content

Look back and look forward


newbtophp

Recommended Posts

Hi,

 

Im trying to figure out how to do the following (examples are below), with regex, im guessing i'd have to look forward and back (if thats the correct term) and then replace accordingly.

 

I hope the examples would explain what its meant to be doing, as Im unsure how to explain.  :-\

 

Examples:

 

 

Input:

 

hello '\';';

 

Output would become:

 

hello '\';

 

---------

 

Input:

hello ';

            ';

   

           

Output would become:

 

Removed (Replaced with nothing)

 

---------

 

Input:

           

hello ';

 

Output would become:

 

Removed (Replaced with nothing)

Link to comment
https://forums.phpfreaks.com/topic/195934-look-back-and-look-forward/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.