LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2003, 05:38 PM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
Perl Regular Expressions


im trying to go through an array, and take out all of the <br> or <BR> in each string of the array, this is what i am doing right now, but it does not work...


for ($i=0; $i <= $#fields_add - 1; $i++){
$fields_add[$i] =~ s/<BR>/ /;
$fields_add[$i] =~ s/<br>/ /;
}
 
Old 11-15-2003, 06:16 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
foreach (@fields_add) {
$_=~s/<br>/ig
}

might need to escape the <>'s, not sure though.

Last edited by acid_kewpie; 11-15-2003 at 06:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl regular expressions CyberJedi Programming 2 10-02-2005 12:17 PM
Perl regular expressions daYz Programming 6 08-11-2005 08:27 AM
Perl and Regular Expressions Fonk Programming 1 06-27-2004 12:32 PM
Regular Expressions overbored Linux - Software 3 06-24-2004 03:34 PM
Regular expressions aromes Linux - General 1 10-15-2003 01:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration