Question: As part of a project, I need to analyse string which may contain a reference to PHP in the following manner:

`[php]functionName(args1, args2)[/php]`

The function name is not always the same, and I would like to replace everything in the above example (including the pseudo-tags) with another value. 

Can anyone suggest a Regular Expression to effectively match the pattern `[php]anything[/php]`. 

Sorry if this is a basic question, but I suck at Regular Expressions!

Answer: 
```
<?php

$s = "Lorem ipsum dolor sit amet, [php]functionName(args1, args2)[/php] ok.";

echo preg_replace("/\[php\][^\[]+\[\/php\]/", "seems to work", $s) . "\n";

// prints => Lorem ipsum dolor sit amet, seems to work ok.

?>

```
try using

```
\[php\](.*)\[\/php\]

```