The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Split Command in Perl rochitsharma UNIX for Advanced & Expert Users 9 03-09-2008 03:56 AM
Help Needed : Split one big file to multiple files monicasgupta Shell Programming and Scripting 5 03-03-2008 07:09 PM
Split a file with no pattern -- Split, Csplit, Awk madhunk UNIX for Dummies Questions & Answers 10 12-17-2007 12:57 PM
Split data into multiple lines kingofprussia UNIX for Dummies Questions & Answers 5 07-31-2007 02:48 PM
perl split function new2ss Shell Programming and Scripting 5 06-08-2006 11:17 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-31-2006
umen umen is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 239
multiple pattern split in perl

Hello all
i have complex string that i will like to split to or to break to parts
my string is :
"foo1+foo22-blah*blah(var)+fooA(var)"
now i need to break this string so that every part of the string will be element in array it will b
@stack[0] = "foo1"
@stack[1] = "+"
@stack[2] = "foo22"
@stack[3] = "-"
@stack[4] = "blah"
@stack[5] = "*"
@stack[6] = "blah(var)"
@stack[7] = "+"
@stack[8] = "fooA(var)"

now the problem as you see is the different separators , if i had only one type so i could split this string
by this one type pattern and build that array but here i have multiple type (+|-|*) what will be the best
why to build this array in this case?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0