grep, regex, and difficulty in AppleScript

I am having trouble translating a working shell script regex to AppleScript. What do I need to change on the AppleScript side?

Here is the working shell script regex

[format]john@mac ~ % ExtractedNoteContents="Test Project

  • [ ] Potential Task 1
  • [ ] <0001f7e2> Potential Task 2 (with some comment; additions)

<0001f7e2> Potential Task 3
More text"
john@mac ~ % echo $ExtractedNoteContents | grep -o ‘<0001f7e2>.*’
??? Potential Task 2 (with some comment; additions)
??? Potential Task 3[/format]

Here is the failing AppleScript regex
[format]set ExtractedNoteContents to "Test Project

  • [ ] Potential Task 1
  • [ ] ??? Potential Task 2 (with some comment; additions)

??? Potential Task 3
More text"
do shell script “echo " & ExtractedNoteContents & " | grep -o ‘<0001f7e2>.*’”
[/format]

Here is the error I get:
[format]sh: line 1: -: command not found
sh: -c: line 2: syntax error near unexpected token (' sh: -c: line 2: - [ ] ??? Potential Task 2 (with some comment; additions)'[/format]

You have to quote ExtractedNoteContents

do shell script "echo " & quoted form of ExtractedNoteContents & " | grep -o '<0001f7e2>.*'"

Thank you. The quoted form option is starting to make more sense.