|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with sed regular expression
Hi all, I want to get a substring from a string based on given delimiter, for example: Code:
str="foo|bar|baz" with delimiter "|", I want to get one substring at each time with the order number the substring in the whole string, given 1 to get "foo", given 2 to get "bar", given 3 to get "baz", I guess it could be done with sed and an regular expression, but I don't know how to write it. Thanks. Roy987 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks.
It worked. |
| Sponsored Links | ||
|
![]() |
| Tags |
| regular expression, sed |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl: How to read from a file, do regular expression and then replace the found regular expression | jessy83 | Programming | 1 | 12-05-2011 03:10 PM |
| help in regular expression | shekhar2010us | Shell Programming and Scripting | 1 | 08-12-2011 03:59 PM |
| Integer expression expected: with regular expression | ketkee1985 | Shell Programming and Scripting | 3 | 03-14-2011 02:49 PM |
| awk and regular expression | maskot | Shell Programming and Scripting | 4 | 05-22-2007 07:22 AM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 10:59 AM |
|
|