Page 1 of 1

preg_match_all -- correct regular expression for string

Posted: Thu Mar 04, 2010 11:12 am
by atomicc
Please, give me the correct preg_match_all code for the following string:

Code: Select all

totals">  Totals:   22   11/6       Daily Average
where I need only the number 6, nothing else. Remember that it could also be a number higher than 6, like 1598.

(I'm actually using the following code that returns the string above:

Code: Select all

 
preg_match_all('/total(.+)verage/si', $conteudo, $conteudo);
)

Thank you very much.

Re: preg_match_all -- correct regular expression for string

Posted: Thu Mar 04, 2010 2:36 pm
by tr0gd0rr
A forum isn't a great place to ask people to write code for you.

If you're not familiar with regex, you could solve your problem another way, such as with explode and trim. If you are familiar with regex or want to learn it, then you need to ask a specific question. Many people tend to ignore posts that start with "Please give me".