Hey guys,
Thanks for clearing that up.
Like I said I am rather new to the xpath (mainly because its not cross
browser at the moment) and css3 syntax.
I recognize the power it holds and it has peeked my curiosity.
Do you know of any resources for finding good usage examples?
P.S. Here is a regexp I use for extracting html elements from text in
php.
The regexp can be used in js too. Its very thorough and allows for
tags like <div title='next >' id="nav">test</div>
$selfClosing = preg_match('/(br|hr|img|input|link|meta|param)/i',
$tagName);
if($selfClosing){
//very thorough regular expression
$pattern = '%<'.$tagName.'(?:(?:(?:\s|\n)+\w+(?:(?:\s|\n)*=(?:\s|
\n)*(?:".*?"|\'.*?\'|[^\'">\s]+))?)+(?:\s|\n)*|(?:\s|\n)*)/>%i';
}
else{
$pattern = '%<'.$tagName.'(?:(?:(?:\s|\n)+\w+(?:(?:\s|\n)*=(?:\s|
\n)*(?:".*?"|\'.*?\'|[^\'">\s]+))?)+(?:\s|\n)*|(?:\s|\n)*)>(?:(?:.|
\n)*?)</'.$tagName.'>%';
}
- Thanx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---