![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question on Regular Expression | Katkota | UNIX for Dummies Questions & Answers | 14 | 05-18-2008 05:11 PM |
| Regular Expression question | Katkota | UNIX for Dummies Questions & Answers | 6 | 05-14-2008 03:23 PM |
| question (regular expression related) | metalwarrior | UNIX for Dummies Questions & Answers | 1 | 02-03-2008 11:51 PM |
| Regular Expression Question | Krispy | UNIX for Dummies Questions & Answers | 3 | 01-20-2006 10:36 AM |
| question about regular expression | brentdeback | Shell Programming and Scripting | 0 | 11-14-2005 04:04 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Regular expression question
hi
i need to wipe out something from giving path i have some thing like that : pwd | sed 's/.*foo//' it is working fine when I have path like : /blah/balh1/foo/moo so it erasing me all that comes before the foo including the foo but I have problem when I have dir by the name of "foo_ver1223i" how can I build regular expression that take into consideration if its "foo" or "foo_blah123i" tnx |
|
||||
|
well this have some problem
you see ..
when i do : s/.*foo*.//g im im wiping out all the line ( i guess ) in both sides of the *foo* but i like to wipe out only the what is until the "foo*" including it . for example: say i have : /blah1/blah2/foo_v123/blah3 after the rexp i expect to get : /blah1/blah2/blah3 and if i get only /blah1/blah2/foo/blah3 after the rexp i expect to get also : /blah1/blah2/blah3 i hope i now its clear now thanks allot |
![]() |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|