Advertisement

04.12.2008 at 10:22AM PDT, ID: 23317538
[x]
Attachment Details

Replace part of text

Asked by mmcw in Perl Programming Language, CGI Scripting

Tags: perl

I do have a text where I want to replace a part starting en ending with: (AFSPRAAK)
I tryed this:

if ($record->{'cust_plan'} =~ /(AFSPRAAK) $r_in->{'day'}-$r_in->{'month'}-$r_in->{'year'} $r_in->{'hh_start'}:$r_in->{'mm_start'} $r_in->{'tot mm_end'}:$r_in->{'hh_end'}: (.*)(AFSPRAAK)/) {
      $record->{'cust_plan'} =~ s/(AFSPRAAK) $r_in->{'day'}-$r_in->{'month'}-$r_in->{'year'} $r_in->{'hh_start'}:$r_in->{'mm_start'} tot $r_in->{'mm_end'}:$r_in->{'hh_end'}: (.*)(AFSPRAAK)//g;
}

where the part (.*) is alway different and not importent!!
When the text between (AFSPRAAK) .... (AFSPRAAK) exist then that part has to be removed!!
What am I doing wrong??

Michel

Start Free Trial
[+][-]04.12.2008 at 03:27PM PDT, ID: 21342752

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.12.2008 at 10:47PM PDT, ID: 21343772

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, CGI Scripting
Tags: perl
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.13.2008 at 02:18AM PDT, ID: 21344170

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.13.2008 at 02:31AM PDT, ID: 21344200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2008 at 02:34AM PDT, ID: 21344208

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.13.2008 at 02:34AM PDT, ID: 21344209

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628