![]() |
|
|
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 |
| regular expressions | melanie_pfefer | UNIX for Dummies Questions & Answers | 8 | 04-10-2008 05:24 AM |
| regular expressions | whatever | Shell Programming and Scripting | 4 | 05-20-2007 05:30 PM |
| regular expressions in c++ | szzz | High Level Programming | 2 | 10-06-2003 11:33 AM |
| Regular expressions in sed | mfreemantle | Shell Programming and Scripting | 2 | 02-12-2002 04:43 AM |
| Regular expressions in sed | mfreemantle | UNIX for Dummies Questions & Answers | 3 | 02-11-2002 09:34 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed and regular expressions problem
Hi
Im trying to use sed to change some files which I'll describe here: I want to use a regular expression to grab the <body> tag from a document. However, the <body> tag can look different so the regular expression used will take care of that and "include" all types of bodies, in example: <body background="green" > will also be replaced. However, that text that goes directly after body, in this case ' background="green" ' needs to be included in the output. "s/<body[^>]*>/<body(I want the trimmed content here)>CONTENT/g" So basically the question is how (and if its possible) to add that content to the output line? <body background="green" > should become <body background="green" >CONTENT and <body> should become <body>CONTENT If you don't understand what I mean, just ask me and I'll try to describe it in another way ![]() Thank you! |
| Bookmarks |
| Tags |
| regular expressions, sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|