in reply to Re^2: Simple Regex drives me insane
in thread Simple Regex drives me insane

I updated my last reply

But I think it might be better to step back and consider what you are trying to achieve.

If you can use code, that may be simpler:

my $in = "foo"; my $out = $in =~ /#(.*)/ ? $1 : "";

Replies are listed 'Best First'.
Re^4: Simple Regex drives me insane
by ikegami (Patriarch) on Mar 30, 2024 at 18:51 UTC

    I'm not the OP.

    The .* should be \S*, \S+, \w*, \w+ or something. It's unclear what should be used exactly, but .* matches too much.

    The above also applies for the first .* in your edited code.

    The second .* in your edited code is useless. You could just leave it out.

Re^4: Simple Regex drives me insane
by eyepopslikeamosquito (Archbishop) on Mar 30, 2024 at 21:31 UTC