PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hummm, a regex? how can i say more about regex?
a regex is related to pattern.
ya should do a search on google on perl regex.
ive followed like 20 hours in classes about regex, so its a bit hard to explain in really well here.
ya can search for regex tutorials, that would be nice.
if ya're still getting trouble, after searching and reading, of course, im gonna try to send ya tutorials that would help ya.
McGruff: he seems to dont know whats a regex, so giving him the answer wont help him, i think.
he needs to read more and be able to make his owns regex, no?
later
junky wrote:McGruff: he seems to dont know whats a regex, so giving him the answer wont help him, i think.
he needs to read more and be able to make his owns regex, no?
later
Fair point - pushed for time but I maybe can explain more.
Regex stands for regular expressions. A very powerful tool for finding or replacing patterns in strings.
In php there's posix style ereg, eregi fns which should not be used since they're less efficient than the perl style peg_match, preg_replace etc.
Better still, use the string fns str_replace, strstr etc (if you can achieve what you want with these).
Just adding some useful tips. Regarding [blocks] to [/block] replacements, consider downloading for example this very board (phpbb) and look at it's code in the files that handles posting. There you have good examples of img/code/php/bold/etc usage.
HTML syntax is interesting. Dont think there are, but it wouldn't be to hard to whip up. Anyone know the standards for coloring html?
i might say that can be done by knowing all the functions, put them in a array or string separated by commas and then when the str_replace finds it in the block of text it adds up the corresponding <span style="color: ?????">text</style> tags... and also for reserved words an array and all that stuff