in reply to Use global flag when declaring regular expressions with qr?
Oh, I see. Thank you both, that seems to do the trick just fine :)
This makes me curious about something I read regarding the qr operator, and that is that it's supposed to compile the pattern provided as it's being saved into the variable. But, wouldn't this approach of enclosing it again with /$re/g, as in this case, defeat the purpose of it? Are there any penalties in terms of performance? Not that I actually care much about it right now, I'm just curious.
Thanks again!
PS: Do I need to mark this question as solved somewhere?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Use global flag when declaring regular expressions with qr?
by ikegami (Patriarch) on Oct 28, 2024 at 15:15 UTC | |
by choroba (Cardinal) on Oct 28, 2024 at 18:23 UTC | |
by unmatched (Sexton) on Oct 28, 2024 at 15:20 UTC |