954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Regex Vs Dom ?

Hi,

I need some deep knowledge Regex Vs Dom.

Is Regex much faster then Dom or not?

Like processing speed, reliable or not .

If any one share link or article it helpful for me.

Aamit
Posting Whiz
342 posts since Apr 2008
Reputation Points: 3
Solved Threads: 15
 
minitauros
Junior Poster
109 posts since Apr 2011
Reputation Points: 36
Solved Threads: 17
 

It all depends on what you want to achieve. It is usually better to use the DOM for parsing HTML/XML. In few occasions where you can't load it due to parsing errors, a regular expression may get you there, but it can also cause a lot of headaches. Some things just are not possible with a regular expression.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

Suppose i want to find anchor tag ->href value only from large file set no of files

so is reliable to go with Dom / Regex.
because Regex is faster then Dom in text processing

Aamit
Posting Whiz
342 posts since Apr 2008
Reputation Points: 3
Solved Threads: 15
 

Do a speed test and find out. Using the DOM will be more reliable.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: