Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Simple regex

by Dietz (Curate)
on Jan 19, 2005 at 12:55 UTC ( #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


Comment on Re: Simple regex
Select or Download Code
Re^2: Simple regex
by Isothop (Novice) 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 !

      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!
      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 :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-26 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls