<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>Yes it's true indexOf() is faster than a RegExp. 
But in this case you must consider that you are running the indexOf() on the innerHTML, which isn't a field but a property. This means when you &quot;call&quot; the innerHTML a function behind it serialize the DOM into a string an return it.
For this reason the innerHTML.indexOf() is slower than the HTMLDocuemnt.evaluate and String.indexOf() is faster than a RegExp.</body>
  <body-html>&lt;p&gt;Yes it's true indexOf() is faster than a RegExp. 
&lt;br /&gt;But in this case you must consider that you are running the indexOf() on the innerHTML, which isn't a field but a property. This means when you &quot;call&quot; the innerHTML a function behind it serialize the DOM into a string an return it.
&lt;br /&gt;For this reason the innerHTML.indexOf() is slower than the HTMLDocuemnt.evaluate and String.indexOf() is faster than a RegExp.&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-12-20T22:39:42Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">85068</id>
  <topic-id type="integer">18247</topic-id>
  <updated-at type="datetime">2008-12-20T22:39:42Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">28612</user-id>
</post>
