0

I have been programming a word-unscrambler. I need to parse the information between a group of tags and another, and put all matches into an array. The beginning tag is:

<tr> <td></td><td><li>

and the ending tag is:

</li></td> </tr>

I know some regular expressions, but I am unfamiliar with PHP.

2 Answers 2

2
<tr> <td><\/td><td><li>(.*)<\/li><\/td> <\/tr>

Test is here: http://rubular.com/regexes/13241

Sign up to request clarification or add additional context in comments.

Comments

0

PHP can cope with both PERL and POSIX regexes, so you'll need to use the function for the flavour that you know. I believe that the code posted by @Gazler should work in either case, though it will need to be surrounded by /s, and quoted:

$reg = '/<tr> <td><\/td><td><li>(.*)<\/li><\/td> <\/tr>/';

There's a PHP PERL regex based test site here: http://j-r.camenisch.net/regex/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.