Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> preg_match, problem
toth
post 6.11.2005, 21:00:53
Post #1





Grupa: Zarejestrowani
Postów: 35
Pomógł: 0
Dołączył: 27.12.2004

Ostrzeżenie: (0%)
-----


witam i od razu przejde do sedna bo pozno snitch.gif

chce wyciagnac wartosc przypisane do etykiet.
mam 2 pytania czy to co robie nizej jest optymalne?
jak za pomoca reg_exp odnalezc znak konca linii?

Cytat
READS-000003/SEC WRITES-000001/SEC HIT RATIO-045%
STORAGE-010%



  1. <?php
  2.  
  3. preg_match('#READS[-]([0-9]*)[/]SEC[ ]*WRITES[-]([0-9]*)[/]SEC[ ]*HIT[ ]*RATIO[-]([0-9]*)[%][ ][*]*STORAGE[-]([0-9]*)[%][ ]*#', $line, $line2);
  4.  
  5. ?>


dziekuje i pozdrawiam
toth
Go to the top of the page
+Quote Post
misterLu
post 7.11.2005, 00:59:31
Post #2





Grupa: Zarejestrowani
Postów: 36
Pomógł: 0
Dołączył: 27.08.2004

Ostrzeżenie: (0%)
-----


$ This is the "end of line" symbol. When used immediately before the ending delimiter, it signifies "at the end of the line". For instance:

$string =~ m/Bill Clinton$/; #true only when "Bill Clinton" is the last text in the string

źródło:
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

funkcje preg_* obsługują perlowe wyrażenia regularne,
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 7.07.2025 - 02:21