Extract text between two unicode symbols using AppleScript or bash?
This runs with Bash, but it evokes some Ruby code:

ruby - &lt;&lt;EOF
puts /▶[^•]*•/.match("▶the first •2•3•4•5•666643")
EOF


If you decide to use AppleScript, you have a lot of options for what to match against:

on run {input, parameters}
    set var to "▶the first •2•3•4•5•666643"

    set output to (do shell script ¬
"ruby - &lt;&lt;EOF
    puts /▶([^•]*)•/.match('" &amp; var &amp; "')[1]
EOF")

    return output
end run


Alternatively, sed can be used, which is easier for working with files:

sed -E 's/.*▶([^•]*)•.*/\1/' filename.txt