Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
parsiranje pomoću regex

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Filip



Joined: 12 Jan 2008
Posts: 19

PostPosted: 19.10.2012 09:55    Post subject: parsiranje pomoću regex Add user to your forum ignore list Reply with quote

Pozdrav

želim parsirati sve js filove preko php-a i odrediti imena klasa koji se koriste

npr. ovak nešto trebam u konačnici
"var items = new Cms.News.Application({app:, this});"
treba mi vratiti u polje $new[] = 'Cms.News.Application'
ili
"Cms.News.Application = Ext.extend(Cms.Core.Application, { "
$extend[] = array('original' => 'Cms.News.Application',
'extend' => Cms.Core.Application'

trenutno se mučim s regularnim izrazima, moram priznati da ih nisam prije nisam koristio
Code:

$line = "var items = new Cms.News.Application({app:, this});";
preg_match('/.*new ([a-zA-Z.]\w+)/', $line, $matches);
print_r($matches);

Kao rezultat dobijem Cms. umjesto Cms.News.Application

isprobao sam 1000 kombinacija, ali nikako da pogodim onu pravu, pa trebam pomoć
Back to top
View user's profile Send private message
snyder



Joined: 21 Dec 2005
Posts: 57
Location: Zagreb

PostPosted: 19.10.2012 10:36    Post subject: Add user to your forum ignore list Reply with quote

Code:
preg_match('/.*new ([a-zA-Z\.]+)/', $line, $matches);

vrati
Code:
Array
(
    [0] => var items = new Cms.News.Application
    [1] => Cms.News.Application
)


dalje ces valjda znati? Smile

_________________
www.prijevodi-online.org | www.serije.org | www.prijevodi-offline.org | www.cro-guild.com | www.affinity-sw.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Filip



Joined: 12 Jan 2008
Posts: 19

PostPosted: 19.10.2012 11:42    Post subject: Add user to your forum ignore list Reply with quote

hvala ti snyder

nadam se da ću dalje znati, joj kako mi to nije palo na pamet Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group