LinuxQuestions.org
Review your favorite Linux distribution.
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, 04: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, 05:16 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

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

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

Last edited by acid_kewpie; 11-15-2003 at 05: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 11:17 AM
Perl regular expressions daYz Programming 6 08-11-2005 07:27 AM
Perl and Regular Expressions Fonk Programming 1 06-27-2004 11:32 AM
Regular Expressions overbored Linux - Software 3 06-24-2004 02:34 PM
Regular expressions aromes Linux - General 1 10-15-2003 12:29 PM


All times are GMT -5. The time now is 02:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration