XP is just a number | |
PerlMonks |
Regex or Normal Replace?by Lejocode (Novice) |
on Apr 17, 2017 at 01:41 UTC ( [id://1188074]=perlquestion: print w/replies, xml ) | Need Help?? |
Lejocode has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks, A quick question, if i have a large normal replace list, something like 50,000. and can be shorten to 10,000 with regex. Which method would be the faster? #EDIT sorry for prior unclear briefing, here's an example: "efg" is a word, and can be precedented by "ab" or "cd" or both, and it is still the same word. and i need to deal with it on word boundaries as it can be a part of another words. so i can use: 1- regex: s/\b(ab)*(cd)*efg\b/$1$2exg/g; 2- normal replace: i know that might seems weird to you, but in my language, it doesn't. so with large list of words like "efg", the question is: "Which method would be the faster?"
Back to
Seekers of Perl Wisdom
|
|