How to search for curly quotes in regular expressions?

I’m trying to search for the (opening) curly quotes of the type ‘ and “, but I can only insert the closing ones in the Search field.

Oops, sorry for that! It’s just the representation (because of the font?) that looks like I cannot insert the opening quotes. When I do type them manually, the macro works perfectly:


The codes of double and single, left and right are (in decimal) [8220, 8221, 8216, 8217]

(Test, for example, in AS)

-- "“"
-- "”"
-- "‘"
-- "’"

-- showChar :: Int -> String
on showChar(intID)
    character id intID
end showChar

on run {}
    map(showChar, [8220, 8221, 8216, 8217])
end run


-- map :: (a -> b) -> [a] -> [b]
on map(f, xs)
    script mf
        property lambda : f
    end script
    set lng to length of xs
    set lst to {}
    repeat with i from 1 to lng
        set end of lst to mf's lambda(item i of xs, i, xs)
    end repeat
    return lst
end map

I notice that when you enter the right-hand versions in KM action text fields, the display is, for some reason of the left hand version, but a quick search/replace suggests that the underlying data is not actually changed.

If you look at the section on Regular Expression Metacharacters, you will see the syntax for specifying characters by their codes (which need to be converted to hex, or octal rather than decimal, I think).

PS for a quick JS dec -> hex conversion:

[8220, 8221, 8216, 8217].map(n => n.toString(16))

// ["201c", "201d", "2018", "2019"]