<?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: PERL - pattern extraction help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085103#M92102</link>
    <description>&amp;gt; perl -nle'm{([^/\\]+\.exe)\b}i and print $1' xx.dta&lt;BR /&gt;hpsysdrv.exe&lt;BR /&gt;kbd.exe&lt;BR /&gt;iTunesHelper.exe&lt;BR /&gt;VTTimer.exe&lt;BR /&gt;ALCXMNTR.EXE&lt;BR /&gt;TaskPanl.exe&lt;BR /&gt;iPodService.exe&lt;BR /&gt;ctfmon.exe&lt;BR /&gt;BackWeb-1940576.exe&lt;BR /&gt;wlancfg5.exe&lt;BR /&gt;OCSetup.exe&lt;BR /&gt;ocsetup.exe&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
    <pubDate>Fri, 12 Oct 2007 03:02:22 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2007-10-12T03:02:22Z</dc:date>
    <item>
      <title>PERL - pattern extraction help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085102#M92101</link>
      <description>I have got a file that has patterns similar to the sample provided below&lt;BR /&gt;&lt;BR /&gt;C\WINDOWS\system\hpsysdrv.exe&lt;BR /&gt;C\hp\KBD\kbd.exe&lt;BR /&gt;C\Program Files\iTunes\iTunesHelper.exe&lt;BR /&gt;C\WINDOWS\system32\VTTimer.exe&lt;BR /&gt;C\WINDOWS\ALCXMNTR.EXE&lt;BR /&gt;C\Program Files\EarthLink TotalAccess\TaskPanl.exe&lt;BR /&gt;C\Program Files\iPod\bin\iPodService.exe&lt;BR /&gt;C\WINDOWS\system32\ctfmon.exe&lt;BR /&gt;C\Program Files\Compaq Connections\1940576\Program\BackWeb-1940576.exe&lt;BR /&gt;C\Program Files\NETGEAR\WPN311\wlancfg5.exe&lt;BR /&gt;D\OCSetup.exe&lt;BR /&gt;C\Program Files\Microsoft Windows OneCare Live\Staging\SEA3\ocsetup.exe&lt;BR /&gt;&lt;BR /&gt;I am trying to write a PERL script that would extract only the .exe content from the file like ocsetup.exe, ctfmon.exe etc.&lt;BR /&gt;&lt;BR /&gt;Can anyone please help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Anand</description>
      <pubDate>Fri, 12 Oct 2007 02:17:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085102#M92101</guid>
      <dc:creator>Anand_30</dc:creator>
      <dc:date>2007-10-12T02:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - pattern extraction help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085103#M92102</link>
      <description>&amp;gt; perl -nle'm{([^/\\]+\.exe)\b}i and print $1' xx.dta&lt;BR /&gt;hpsysdrv.exe&lt;BR /&gt;kbd.exe&lt;BR /&gt;iTunesHelper.exe&lt;BR /&gt;VTTimer.exe&lt;BR /&gt;ALCXMNTR.EXE&lt;BR /&gt;TaskPanl.exe&lt;BR /&gt;iPodService.exe&lt;BR /&gt;ctfmon.exe&lt;BR /&gt;BackWeb-1940576.exe&lt;BR /&gt;wlancfg5.exe&lt;BR /&gt;OCSetup.exe&lt;BR /&gt;ocsetup.exe&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 12 Oct 2007 03:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085103#M92102</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2007-10-12T03:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - pattern extraction help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085104#M92103</link>
      <description>Merijn knows perl. Heed his advice!&lt;BR /&gt;&lt;BR /&gt;His code matches and remenbers a piece of string on the line startign with a backslash and ending in .exe.&lt;BR /&gt;If there is seperate text beyond the .exe, then it is ignored, whcih you probably want.&lt;BR /&gt;Is every image ganartueed to be called .exe or could there be a .exe_v3 or such?&lt;BR /&gt;Are there arguments beyond the image?&lt;BR /&gt;&lt;BR /&gt;Will every line have an image, and a \ before the image name?&lt;BR /&gt;&lt;BR /&gt;If the last is true, and other simple approach could be:&lt;BR /&gt;&lt;BR /&gt;perl -pe "s/^.*\\//" test.txt&lt;BR /&gt;&lt;BR /&gt;Here we replace be beginning of every line up the the last backslash with nothing (the .* is 'greedy').&lt;BR /&gt;&lt;BR /&gt;Or if there are other lines in the mix:&lt;BR /&gt;&lt;BR /&gt;$ perl -ne "s/^.*\\//; print if /.exe/" test.txt&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Oct 2007 07:00:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085104#M92103</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-10-12T07:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - pattern extraction help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085105#M92104</link>
      <description>&amp;gt; His code matches and remenbers a piece of string on the line startign with a backslash and ending in .exe.&lt;BR /&gt;&lt;BR /&gt;No, it does not. It matches any sequence of characters that do NOT match a forward or backward slash, followed by a .exe extension and a (zero-width) word boundary, all case-insensitive.&lt;BR /&gt;Essentially, this drops of the path part on both dos and unix.&lt;BR /&gt;&lt;BR /&gt;The weakness in this match is files like D:foo.exe, which will match including the D:, as there is no slash at all and colon's are valid in file names.&lt;BR /&gt;I wrote the regex like that to allow whitespace in file names&lt;BR /&gt;&lt;BR /&gt;If there is seperate text beyond the .exe, then it is ignored, whcih you probably want.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Fri, 12 Oct 2007 07:08:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-pattern-extraction-help/m-p/4085105#M92104</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2007-10-12T07:08:35Z</dc:date>
    </item>
  </channel>
</rss>

