Escape the Candlelit Maze
Retina 0.8.2, 229 bytes

T`#^`d
s`@.*
$&amp;_
@\d|@ ( *\d)
@=$1
(\d *) @|\d@
$1=@
m`^(((.))*@.*\n(?&lt;-2&gt;.)*(?(2)$))(\d| ((.*\n)+(?&lt;-3&gt;.)*(?(3)$)\d))
$1=$5
m`^(((.))*)(\d|(\d(.*\n)+(?&lt;-2&gt;.)*(?(2)$)) )(.*\n(?&lt;-3&gt;.)*(?(3)$)@)
$1$5=$7
@
x
}sT`=`@`.*0.*
s`.*0.*

_


Try it online! Outputs 0 for unsolvable, since solutions must take at least one step. Explanation:

T`#^`d


Change the candle and exit to golfier characters, saving 7 bytes

s`@.*
$&amp;_


If there are still squares to check, then increment the counter. (This allows the loop to terminate once it runs out of squares to check.)

@\d|@ ( *\d)
@=$1


Mark the square to the right if it is lit.

(\d *) @|\d@
$1=@


Mark the square to the left if it is lit.

m`^(((.))*@.*\n(?&lt;-2&gt;.)*(?(2)$))(\d| ((.*\n)+(?&lt;-3&gt;.)*(?(3)$)\d))
$1=$5


Mark the square below if it is lit.

m`^(((.))*)(\d|(\d(.*\n)+(?&lt;-2&gt;.)*(?(2)$)) )(.*\n(?&lt;-3&gt;.)*(?(3)$)@)
$1$5=$7


Mark the square above if it is lit.

@
x


Turn the squares that were checked into walls.

sT`=`@`.*0.*


If the exit still exists, then turn all of the marked squares into squares that need to be checked.

}`


Repeat the above until the exit is reached or no new steps could be taken.

s`.*0.*


If the exit was not reached then delete the count.

_


Convert the count to decimal and delete the input.