I see. I've changed a couple of things to get a solution, and it's fine, but I will read about design patterns anyway.
Thanks,
Edan
User Profile
Collapse
-
C++: Copying protected members of base class to derived class
I have a base class with protected members (`Base`). The function `MakeBase()` is a member function of another class, that returns a `Base` object initialized with private members of this class.
Now the thing is, I want to extend the functionality of `Base` class. I do that by inheriting `Base` class by `Derived`, but then I can't use `MakeBase()` function. It all makes sense to me, but I don't seem to find an appropriate solution.
... -
Okay --
Outputs '1 3' for some reason (while it should output 1 2 3).Code:$string = '1 [fsdfsdfsdf] 2 [fsdfsd] 3'; $string = preg_replace('/\[(.*)\]/', '', $string); echo $string;
Unfortunately, I'm not very good with regular expressions and I can't work this out.Leave a comment:
-
Remove everything between square brackets.
Hello
I'm trying to remove square brackets and everything between them from a string, using regular expressions
I know how to use preg_replace, and know the basics of regex, but can't success.
Can anyone please give me a regex for it?
Thanks in advance!
Edan -
Definitely.
You can use mod_rewrite.
First, you must enable mod_rewrite in httpd.conf. Find the following line and uncomment it (If you have no access to this file, just ask your host company to enable mod_rewrite).
Now create a file named ".htaccess" in your main www directory (or modify an existing one), and write the following:Code:#LoadModule rewrite_module modules/mod_rewrite.so
...Leave a comment:
No activity results to display
Show More
Leave a comment: