<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: regular expression in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505563#M889573</link>
    <description>Well, at first glance I know that it deletes something.  This is denoted by the / at the beginning and the /d at the end.  The middle is what to delete, a set of criteria.  I will do some research on the criteria and reply again.</description>
    <pubDate>Thu, 15 Mar 2001 15:30:39 GMT</pubDate>
    <dc:creator>Jason VanDerMark</dc:creator>
    <dc:date>2001-03-15T15:30:39Z</dc:date>
    <item>
      <title>regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505560#M889570</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i'm confused with an RE i've found in a script:&lt;BR /&gt;&lt;BR /&gt;sed '/^{\\{/,/^}\\}/d'&lt;BR /&gt;&lt;BR /&gt;Has anybody the expierience to explain me what this sed does ?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 15 Mar 2001 14:58:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505560#M889570</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-03-15T14:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505561#M889571</link>
      <description>does it work!!!!!?</description>
      <pubDate>Thu, 15 Mar 2001 15:21:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505561#M889571</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-03-15T15:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505562#M889572</link>
      <description>Andreas,&lt;BR /&gt;&lt;BR /&gt;I recognize this one-liner is a bit complex: it prints all of input file (or echoed piped input) EXCEPT section between 2 regexp, knowing that regexp one is:&lt;BR /&gt;&lt;BR /&gt;* line beginning with opening curly brace, followed by a backslash and immediately followed by another opening curly brace&lt;BR /&gt;&lt;BR /&gt;and regexp 2 is:&lt;BR /&gt;* line beginning with closing curly brace, followed by a backslash and immediately followed by another closing curly brace.&lt;BR /&gt;&lt;BR /&gt;So if your file looks like this:&lt;BR /&gt;--snip--&lt;BR /&gt;this is line 0&lt;BR /&gt;{\{ this is line 1&lt;BR /&gt;line 2&lt;BR /&gt;...&lt;BR /&gt;line n&lt;BR /&gt;}\} this is a trailling text&lt;BR /&gt;--snip--&lt;BR /&gt;&lt;BR /&gt;then 'sed' output will give:&lt;BR /&gt;&lt;BR /&gt;--snip--&lt;BR /&gt;this is line 1&lt;BR /&gt;line 2&lt;BR /&gt;...&lt;BR /&gt;line n&lt;BR /&gt;--snip--&lt;BR /&gt;&lt;BR /&gt;I hope this helps !&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Fred.</description>
      <pubDate>Thu, 15 Mar 2001 15:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505562#M889572</guid>
      <dc:creator>Frederic Soriano</dc:creator>
      <dc:date>2001-03-15T15:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505563#M889573</link>
      <description>Well, at first glance I know that it deletes something.  This is denoted by the / at the beginning and the /d at the end.  The middle is what to delete, a set of criteria.  I will do some research on the criteria and reply again.</description>
      <pubDate>Thu, 15 Mar 2001 15:30:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505563#M889573</guid>
      <dc:creator>Jason VanDerMark</dc:creator>
      <dc:date>2001-03-15T15:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505564#M889574</link>
      <description>What a "&amp;amp;*(&amp;amp;" Brain Drain....&lt;BR /&gt;I tried it...it will parse. But I can't figure out what it's supposed to do...it seems to violate some sed tructure even though it parses...I mean if you want to match in sed you'd \{ \}   So I can't figure the second set of { } surrounding it because { } is awk not sed.&lt;BR /&gt;And that double \\   am I missing something--one \ means turns off the special meaning of the next character, which would negate the \{ \} sed match. The ^ says match the following at the beginning of the line, so what's that other ^ doing.&lt;BR /&gt;Oh my head.....I tried creating a file with some bogus lines starting with a variety of { / \ and so on...&lt;BR /&gt;You know what I got....&lt;BR /&gt;The statement parses ok...and produces a file with all my lines still in tact.&lt;BR /&gt;I'm going to find some excedrin now...I hope someone else had better results...&lt;BR /&gt;&lt;BR /&gt;/rcw&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Mar 2001 15:30:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505564#M889574</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2001-03-15T15:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505565#M889575</link>
      <description>Hi Andreas!&lt;BR /&gt;&lt;BR /&gt;...so was the double backslash a carry-over for those of us who remember the now-defunct need to escape the backslash with itself in order to post to this forum???...so it would read (?):&lt;BR /&gt;&lt;BR /&gt;# sed '/^{\{/,/^}\}/d'&lt;BR /&gt;&lt;BR /&gt;with warm regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 15 Mar 2001 15:35:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505565#M889575</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-03-15T15:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505566#M889576</link>
      <description>Based Frederico's reply, I tried an experiment:&lt;BR /&gt;&lt;BR /&gt;I used this testfile:&lt;BR /&gt;&lt;BR /&gt;{\{dir &lt;BR /&gt;/dir/dir2/dir4&lt;BR /&gt;}\} /&lt;BR /&gt;/dir/dir2/dir5&lt;BR /&gt;/dir/dir2/dir6&lt;BR /&gt;{\{&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And cat'ed it to that sed command:&lt;BR /&gt;&lt;BR /&gt;# cat file | sed '/^{\\{/,/^}\\}/d'&lt;BR /&gt;/dir/dir2/dir5&lt;BR /&gt;/dir/dir2/dir6&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Mar 2001 15:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505566#M889576</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-15T15:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505567#M889577</link>
      <description>Hello again:&lt;BR /&gt;&lt;BR /&gt;Nope. Ugly. Double backslashes are correct.  It won't parse otherwise.  Should have tried it first ;-)&lt;BR /&gt;&lt;BR /&gt;Great presentation of explanation, Fred!!!&lt;BR /&gt;&lt;BR /&gt;Regards to all!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 15 Mar 2001 15:43:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505567#M889577</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-03-15T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505568#M889578</link>
      <description>Yup Rita, I completely agree! This one is a source of headaches!&lt;BR /&gt;&lt;BR /&gt;To shed some light on this, let's take the following command:&lt;BR /&gt;&lt;BR /&gt;sed '/Iowa/,/Montana/d'&lt;BR /&gt;&lt;BR /&gt;Two regexp are denoted, which are strings "Iowa" and "Montana". sed finds these two strings and uses them as start and end delimiters (see the ending d command), printing whatever is between both (uh I hope you understand -- I'm afraid my english is not as good as I'd like it to be ;o))&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;Curly braces, when backslashed, match a range of occurrences of the single char that immediately precedes it. In Andreas' case, they are not backslashed but considered as curly braces.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;Finally, you are right when saying that a single \ escapes the special char that follows, but if you want to match the char "backslash" (\), then you have to backslash it once more !&lt;BR /&gt;&lt;BR /&gt;I attached to this post a file that contains many sed one-liners, including this one. I'm sure you'll find it useful.&lt;BR /&gt;&lt;BR /&gt;HTH !&lt;BR /&gt;&lt;BR /&gt;Fred.</description>
      <pubDate>Thu, 15 Mar 2001 15:47:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505568#M889578</guid>
      <dc:creator>Frederic Soriano</dc:creator>
      <dc:date>2001-03-15T15:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505569#M889579</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;Yes you're right. I even said it: "this sed command prints all of file EXCEPT section between two regexps", and i confused myself when replying:&lt;BR /&gt;&lt;BR /&gt;--snip--&lt;BR /&gt;this is line 1&lt;BR /&gt;this is line 2&lt;BR /&gt;...&lt;BR /&gt;this is line n&lt;BR /&gt;--snip--&lt;BR /&gt;&lt;BR /&gt;Of course, this is the opposit, ie:&lt;BR /&gt;&lt;BR /&gt;--snip--&lt;BR /&gt;this is line 0&lt;BR /&gt;this is the trailing text&lt;BR /&gt;--snip--&lt;BR /&gt;&lt;BR /&gt;Again, sorry for mistake! (Uh where is my AlkaSeltzer ?!)&lt;BR /&gt;&lt;BR /&gt;Fred.</description>
      <pubDate>Thu, 15 Mar 2001 15:53:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505569#M889579</guid>
      <dc:creator>Frederic Soriano</dc:creator>
      <dc:date>2001-03-15T15:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505570#M889580</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I would have never thought that this question would release as much.&lt;BR /&gt;&lt;BR /&gt;Thank you for all the great responses.&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;&lt;BR /&gt;Andreas</description>
      <pubDate>Thu, 15 Mar 2001 16:05:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505570#M889580</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-03-15T16:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505571#M889581</link>
      <description>Frederic,&lt;BR /&gt;&lt;BR /&gt;Many Thanks - and you explained it well !&lt;BR /&gt;&lt;BR /&gt;I am working at trying to improve my very basic sed &amp;amp; awk (much needed) skills...so things like this really help make me think.  &lt;BR /&gt;And Thanks to Andreas for posting the challenge !&lt;BR /&gt;&lt;BR /&gt;/rcw&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Mar 2001 17:59:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505571#M889581</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2001-03-15T17:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505572#M889582</link>
      <description>Rita,&lt;BR /&gt;&lt;BR /&gt;O'Reilly puts out what I have heard is a very good book on sed and awk.  It is called 'SED &amp;amp; AWK' and it is one of the nutshell books that they put out.  It is recommended to get at least the 2nd edition.&lt;BR /&gt;&lt;BR /&gt;When I was at HP World in San Francisco in 1999, I attended a very good seminar on awk that David Totsch tought.  I have a hard copy of the seminar handout, and it should be on the HP World CD, if I can find it.  If you are interested let me know. (patrickwallek@upr.com)</description>
      <pubDate>Thu, 15 Mar 2001 18:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2505572#M889582</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-15T18:22:22Z</dc:date>
    </item>
  </channel>
</rss>

