frmwrk123/com.woltlab.wcf.bbcode — comment on commit e87899f0341ce5e5c26a02e5d0350ca2f01a2d57
File:  line 0
By frmwrk123:

Well if I see that there're two object methods in which preg_replace was used than it would require to write e.g.:
$regex = new Regex($pattern);
$regex->replace($this->text, $replacement);

I had to do this three times, one time for the url, one time for the email and one time for the cacheCodes. So i write this code three times and if something changes I have to change this at all three places. In this case there're just two lines of program code. But generally I learned that you're supposed to prevent Copy&Paste code. This is the reason why I have implemented an extra method which is called each time.
In addition one of the highest aims should be to write reusable code and avoid writing code multiple times.

I exactly tried to avoid writing the same code each time. Here a link to a description of the rule I tried to use: http://openbook.galileocomputing.de/oop/oop_kapitel_03_003.htm#mj637b1f986c2e9441d2d305cafc96f6ac