PHP regex use same letter

Jigglypuff

New Member
Im trying to do a regex where I can find all html tags, but for each one, each opening and closing tag must be the same. Heres what I mean: (Yes I only want max 3 letters)\[code\]preg_match_all("/\<[a-z]{1,3}\>(.*?)\<\/[a-z]{1,3}\>/", $string, $matches);\[/code\]Where the 2 \[code\][a-z]{1,3}\[/code\] are, I want those to be the same, so it doesn't match \[code\]<b>\[/code\] with \[code\]<\i>\[/code\], etc. Thanks... let me know if you need further explanation
 
Back
Top