I'm having trouble matching text and numbers within these types of square brakets [] I'm trying the following but no luck... '~[(.*?)]~s' PHP:
Technically it's not a PHP problem, it's an issue with the Perl-compatible regular expression syntax the preg_ functions use. Yeah yeah I know I'm being a sort of grammer Nazi here, but there are lots of things that use Perl-compatible regular expressions. The quicker you learn that the syntax is its' own separate thing and not actually a "PHP thing", the more you'll be able to learn.
Yeh sure that's fine, but the regular expression was within a php function so it fits in this category as other people will understand what I'm trying to achieve with the php function in the first place.
That function is just a wrapper for the Perl-compatible regular expression library. Your question doesn't even include syntax that isn't part of the regular expression.
So you're saying: 1) what he was asking was to do with Perl-compatible regular expressions, nothing to do with PHP 2) he should have said 'it's always the smallest problems in regex' since whether or not he's using the regex itself in Perl or in PHP's preg_match, it all boils down to regex concerns ?