in reply to Regex Optimization Question
I think I'd probably do it like this:
But I don't know if that's more efficient as you haven't told us what axis of efficiency you're interested in. There's efficiency in execution time, efficiency in memory usage, efficiency in programmer time, etc. Generally programmer time is the most important thing to optimize for, so if you understand my version and it does what you want, then maybe it's more efficient. :-)$string =~ /Win32_Account.Domain="(.*?)",Name="(.*?)"/; print $2 eq "" ? "Account Deleted" : "$1\\$2";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex Optimization Question
by ikegami (Patriarch) on Mar 23, 2006 at 20:05 UTC | |
by aweeraman (Novice) on Mar 23, 2006 at 20:28 UTC | |
by ikegami (Patriarch) on Mar 23, 2006 at 21:54 UTC | |
|
Re^2: Regex Optimization Question
by JavaFan (Canon) on May 16, 2011 at 09:37 UTC | |
by duff (Parson) on Jun 29, 2011 at 17:48 UTC | |
by JavaFan (Canon) on Jul 03, 2011 at 20:14 UTC |