in reply to Re^2: replace some emoticons - search pattern needed
in thread replace some emoticons - search pattern needed

echo "😘 🚕" | perl -CSD -nE 'printf "%x\n", ord $1 while m{(.)}g'

suggests that the hex code for the face is 1f618 and for the taxi is 1f695

(-CSD is the command-line equivalent of use open...)
But if I try to replace it with my LaTeX-code, it is not working anymore!
Post your code then...

echo "😘 🚕" | perl -CSD -pE 's/\x{1f618}/some_latex_code/'

output:

some_latex_code 🚕

Replies are listed 'Best First'.
Re^4: replace some emoticons - search pattern needed
by marek1703 (Acolyte) on Dec 19, 2014 at 11:03 UTC

    Wow! That's really impressing, what you do with your shell. Suppose I have to read perlrun to learn all this stuff!
    Finally I understood, for what I have to search: \x{1f618} !!! But why my replacement is not working?
    I am stumbled! marek

    while(<>) { # foreach (/\x{1f618}/g) {print "hurray! And here is your emoticon!\n" +}; # this is working!!! # foreach (/\x{1f695}/g) {print "hurray! And here is your emoticon!\n" +}; # this is working!!! This is for the taxi s/\x{1f618}/latex_code/g; }
      Maybe because you forgot to print $_ after replacing...

        I am ashamed! This was it! Suppose the Santa Claus will not come anymore! What a shame!
        Thank you for your help! Great Forum!