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
Need Help with Simple Regex evilfreakz Shell Programming and Scripting 15 08-31-2008 09:07 PM
A simple find and replace without using any regex (bash) srikanths Shell Programming and Scripting 2 03-18-2008 08:08 AM
Problem with grep Regex Error lweegp Shell Programming and Scripting 6 11-16-2006 04:04 AM
gcc 3.4 Regex problem manishs13 SUN Solaris 0 05-09-2005 04:58 AM
grep regex problem iceman Shell Programming and Scripting 2 02-06-2005 12:44 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 03-31-2009
muay_tb muay_tb is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 33
Simple regex problem?

Hi all,

I am looking to create words from a sentence which adhere to a custom search pattern from my website:

Example:

![hello] +![bye] /[said] +=[from] ~[to]

where the terms ! = not, +! = AND NOT, += - and equals and ~ = can be like....

Now here is the issue...i want to split a sentence like the one above on spaces, this is easily done in PHP with a simple split on " ". However this will not work if i have something like:

![hello] +![bye] /[said] +=[from] ~[to] my name

as my name is not surrounded with any of the custom tags and has a space in it...

so basically my output should be:

![hello]
+![bye]
/[said]
+=[from]
~[to]
my name

Any help people?

Last edited by muay_tb; 03-31-2009 at 12:07 PM..
 

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 06:59 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