For quick and simple code, you can use String methods to get the character index of the "#". Below is an example that gets the index of the space character that is directly in front of the second "#". This code example assumes you are wanting to create a new String that has everything up to the second "#" character.
var demoText:String = "hello world #dontremoveme here #1remove #2removeme #3remove";
var index1:int = demoText.indexOf("#");// find first instance of "#" in the String
var index2:int = demoText.indexOf("#", index1 + 1) - 1;// find the index of the space character right before the second instance of "#"
var newText:String = demoText.substring(0, index2);// newText = "hello world #dontremoveme here"
To explain line 3, you are searching for the index of the "#" character starting the search from the index of the first "#" + 1. The "+ 1" is to have the search start after the first "#" character. If you don't have that, you would keep finding the same index value as "index1". The "- 1" at the end is to decrease the index2 value so it will give you index of the space character directly in front of the "#". Line 4 creates a new String starting from the beginning of the original String up to, but not including, the space character in front of the second "#".
If you needed something more complicated than just removing everything after "here" then I would need a different example.
Edit: Here is a link to the AS3 API for the String class. String - Adobe ActionScript® 3 (AS3 ) API Reference