xychange won't recognize an em-dash

I am trying to write a xychange transformation that matches on an em-dash that is preceded or followed by a space and outputs an em-dash without the space. Transforming Data doc (Table 3-2) shows several ways to represent an em-dash but I can't get my match to recognize any of them. Seems simple enough but apparently too tough for me... Can anyone help?

Parents Reply
  • Jay, you got it!


    So if you want to match the string:

    EMDASH<focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>

    You simply do:

    $str =~ s/\xe2\x80\x94\x3c\x66\x6f\x63\x75\x73\x5f\x65\x6e\x64\x20\x66\x6f\x63\x75\x73\x5f\x69\x64\x72\x65\x66\x3D\x22\x2A\x22\x20\x66\x6\xF6\x37\x57\x35F\x6E\x75\x6D\x62\x65\x72\x3D\x22\x2A\x22\x2F\x3E\x3C\x66\x6F\x63\x75\x73\x5F\x73\x74\x61\x72\x74\x20\x69\x74\x65\x6D\x72\x65\x66\x3D\x22\x2A\x22\x20\x66\x6F\x63\x75\x73\x5F\x69\x64\x3D\x22\x2A\x22\x20\x66\x6F\x63\x75\x73\x5F\x6E\x75\x6D\x62\x65\x72\x3D\x22\x2A\x22\x2F\x3E/....

    It can not get much simpler than that!

Children