Author Topic: Look back and look forward  (Read 400 times)

0 Members and 1 Guest are viewing this topic.

Offline newbtophpTopic starter

  • Devotee
  • Posts: 624
  • PHPFreaks Fan!
    • View Profile
Look back and look forward
« on: March 20, 2010, 02:02:21 PM »
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:

Code: [Select]
hello '\';';
Output would become:

Code: [Select]
hello '\';
---------

Input:
Code: [Select]
hello ';

            ';
   
           
Output would become:

Code: [Select]
Removed (Replaced with nothing)
---------

Input:
           
Code: [Select]
hello ';
Output would become:

Code: [Select]
Removed (Replaced with nothing)
« Last Edit: March 20, 2010, 02:05:09 PM by newbtophp »
Quote from: AngelicS
You DO NOT have to say thank you =)
I find it meaningless ^^

Offline newbtophpTopic starter

  • Devotee
  • Posts: 624
  • PHPFreaks Fan!
    • View Profile
Re: Look back and look forward
« Reply #1 on: March 20, 2010, 02:26:17 PM »
Figured it out  ;)
Quote from: AngelicS
You DO NOT have to say thank you =)
I find it meaningless ^^