How to replace non-Roman characters to "_"

How to replace in text string non-Roman characters and letters and punctuations to “_”?

in javascript it looks like:
str.replace(/[^A-z0-9.,-]/g, "")

and what’s about AS?

set theText to "Your string here"
set modString to do shell script "/bin/echo " & quoted form of theText & " | sed 's/[a-zA-Z0-9\\.,-_]/_/g'"

or


set theText to "abcde_1234{}.,-ªºâˆ†"
do shell script "/bin/echo " & quoted form of theText & " | /usr/bin/tr -c '[:alnum:],.-' _"
--> "abcde_1234__.,-________"

For the NON-UNIX geeks out there can you explain a bit of what your shell scripts are doing?

/bin/echo prints the text to stdout (standard output)
the pipe b[/b] passes the text to the next command
/usr/bin/tr translates all characters which are not (indicated by the -c flag) alphanumeric and not “.,-” to the underline character.
The single quotes escape special characters