Forum Moderators: coopster
$text=preg_replace_callback('/\[([A-Za-z0-9\¦\'.-:underscore:]+)\]/i' , "findLinks", $text);
However, this does not match spaces for some odd reason (the "." should match them, I think). I've added "\s", "\w", " ", and ":space:" to the regex (tried both before the A-Z and after the 0-9) but for whatever reason those spaces are not detected. Why? What must I do?
I'm certain that what I think is a space is most certainly a space. str_replace(" ", "", $text); closes the spaces, so I know that php does in fact see it as a space.
I'm on php 5.x if it's relevant. Thanks in advance for any assistance.
Dotan Cohen
The minus (hyphen) character can be used to specify a range of characters in a character class. For example, [d-m] matches any letter between d and m, inclusive. If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class.
Pattern Syntax [php.net]
If the solid pipe character does what you want, then I guess everything is good and dandy :)
And yes I know I use too many smilies :) ...hehe