in reply to Re: Convert hex to HTML
in thread Convert hex to HTML

If you think of the text as text in a text file, instead of text in Perl source code, then the \uXXXX escapes would suggest Javascript Unicode escapes, which are usually comprised of four letters.

Adapting your regex to such text would then yield the same result as your other approach though.

But as we lack further information, it's kinda hard to determine what was really meant.

Replies are listed 'Best First'.
Re^3: Convert hex to HTML
by kcott (Archbishop) on May 15, 2014 at 08:06 UTC

    Yes, you could well be right about that.

    #!/usr/bin/env perl -l use strict; use warnings; use JSON; my $text = '{"html":" \u003cdiv class=\"ja-job-details\"\u003e \u003ch +2 ' . 'class=\"title\"\u003eGlobal Service ..."}'; print decode_json($text)->{html};

    Output:

    <div class="ja-job-details"> <h2 class="title">Global Service ...

    -- Ken