Adding a comment character to the beginning of a line

How do I add a comment character (#) to the beginning of a line?
Example:

# this is my comment

At the moment the character is inserted, taking into account the tabs.
Example:

		# this is my comment

That is, I need to insert a character without taking into account indentation.
Regexp in the comment block doesn’t work :frowning:

<comments>
	<single>
		<expression>^#</expression>
	</single>
</comments>

It is necessary to fix a bug with a broken expression. To be able to add a more complex construction for comments, such as:

<comments>
	
	<single>
		<starts-with>
			<expression>^#</expression>
		</starts-with>
		<ends-with>
			<expression>[\n\r]</expression>
		</ends-with>
	</single> 
	
	<multiline>
		<starts-with>
			<expression>\^rem{</expression>
		</starts-with>
		<ends-with>
			<expression>}</expression>
		</ends-with>
	</multiline>
	
</comments>