So, I'll start off with posting some code:
$output = preg_replace([
'/#(.*?)/i'
], [
'<h1>$1</h1>'
], "#Input");
And that ended up outputting:
<h1></h1>
Input
In HTML OPT, the output I'd like to achieve is <h1>Input</h1> from inputting #Input, kind of like Markdown, but this is for a basic editing system.
I looked into a Regex Debugger (here) and the debug/stack trace was that the first group was nothing, and the index group was the #.
To my knowledge, the only things that are taken and put into groups (I was told this) is ( ... )'s, and from left -> right the groups are labelled from $1 -> $x.
Sorry for the overused REGEX questions.