How can I solve this problem by writing a small regular expression?

Source: Internet
Author: User
The data format for writing a small regular expression is: 0, 37 & lt;/td & gt; & lt; tdclass = & quot; Pdata & quot; & gt; requires matching the final in the php environment. thank you! (As long as, other data is discarded), PHPcode $ str helps write a small regular
Similar data format: 0, 3772, 5
We need to match the final to the php environment. thank you!
(As long as, other data is discarded)

------ Solution --------------------
PHP code
$ Str = '0, 3772, 5 '; preg_match ("/.*? ([\ D] +, [\ d] +) $/", $ str, $ m); echo $ m [1]; // 72,5
------ Solution --------------------
PHP code
    95001100072, 5Bla... '; preg_match_all ('/(? :(.*?) <\/Td>) +/S', $ str, $ matchs); echo $ matchs [1] [0];
------ Solution --------------------
Discussion

0,355, 5 May Be950011000This format

------ Solution --------------------
Discussion
Which of the following formats do you have mentioned above? Is it 0,355?

------ Solution --------------------
Is that true?

How much is the difference
PHP code
Preg_match ("/. *> ([\ d,] +)/", $ str, $ m); echo $ m [1];
------ Solution --------------------
Yes
------ Solution --------------------
Discussion
$ Str = '0, 3772, 5 ';

$ Kk9 = split ('[>]', $ str );

Can I use this array to separate the content of the last array?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.