in reply to [table] regex
/./ doesn't match newlines unless you use the "s" modifier.
/\[table\].*\[\/table\]/s
You'll find this will give you problems if you have more than one set of table tags in the input, since it'll match the first opening tag and the last closing tag. Change .* to .*? to do minimal matching.
/\[table\].*?\[\/table\]/s
This approach won't work if you can have nested tables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [table] regex
by ultranerds (Hermit) on Aug 18, 2009 at 17:08 UTC |