LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Hairy regexp question

[ILUG] Hairy regexp question

Niall O Broin niall at linux.ie
Wed Oct 22 09:03:31 IST 2008


I'd like to be able to extract   'Joe Bloggs'  from this:

<span class="label"><span class="highlight"><span class="highlight- 
inner"></span></span>
<span title="offline" class="name presence-offline">Joe Bloggs</ 
span><ul class="profile-links">
<li class="view-profile first"><a href="/users/joebloggs" title="View  
user profile">
View profile</a></li>
<li class="view-blog"><a href="/blog/88" title="View blog">View blog</ 
a></li>
<li class="add-contact"><a href="/relationship/88/request? 
destination=dashboard%2Flatest-activity" title="Add to your contacts">  
Add associate</a></li>
<li class="send-message last"><a href="/" title="Initiate a chat  
conversation with Joe Bloggs"  
onclick="javascript:Drupal.xmppclient.message_chat(&#039;joe.blogs at whatever.com 
&#039;);;return false;">Initiate chat</a></li>
</ul></span></span>

i.e. I need to extract the value from the first tag which DOESN'T have  
any enclosed tags.

Now, I could write some code to do this in Perl or Ruby, but I'd like  
to be able to do it with a pure RE if it can be done.


Niall




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell