Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Simple regex

by Dietz (Curate)
on Jan 19, 2005 at 12:55 UTC ( [id://423357]=note: print w/replies, xml ) Need Help??


in reply to Simple regex

Maybe this is what you're looking for:
$text =~ s/(.+\s)\S*\.\S*/$1/g;


OUTPUT:
0000 636d6400 5589e583 ec0831c0 83e4f0e8 0010 00000000 e8000000 0083ec0c 68000000 0020 00e80000 000031c0 c9c39090 90909090

Replies are listed 'Best First'.
Re^2: Simple regex
by Isothop (Acolyte) on Jan 19, 2005 at 13:42 UTC
    thanks for your help but the problem is still there.
    this is my source code :
    #!perl -w # use strict; # # Hashes my %struct_compilation = ( "objdump" => "%s -j .text -s -z %s", ); my %compilation = ( "objdump" => "", ); my %return = ( "objdump" => "", ); my $path = "D:/Progs/Programmation/Dev-Cpp/bin/"; my %compiler = ( "objdump" => $path . "objdump.exe", ); # # Main if( @ARGV < 1 ) { exit( 0 ); } my $src = $ARGV[0]; $compilation{"objdump"} = sprintf( $struct_compilation{"objdump"}, $co +mpiler{"objdump"}, $src ); $return{"objdump"} = `$compilation{"objdump"}`; $return{"objdump"} =~ s/[0-9a-f]{4}//g ; print $return{"objdump"};
    i want to print the hexa decimal string whitch is returned by objdump but my regex do the contrary !
      Replace
      $return{"objdump"} =~ s/[0-9a-f]{4}//g;
      with
      $return{"objdump"} = join("",$return{"objdump"} =~ /[0-9a-f]{4}/g)
        thanks to you ! it works :)

      For those of us not blessed with windows and objdump can you post a frag of the objdump output so we can see what to aim for.

      Thanks,
      R.

      Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://423357]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found