Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > How do I identify word<html><html>other word?

Reply
Thread Tools

How do I identify word<html><html>other word?

 
 
Laura
Guest
Posts: n/a
 
      06-04-2004
I have a situation where I want to find two or more words next to each
other (e.g. "sure thing"). Between those words in the text I'm
searching there can be just white space OR any number of html tags.
How do I write a regexp that will identify this? I've tried the
following, but it doesn't work:

(\\b)(sure\\s+|<\\w*>thing)(\\b)

Thanks for any help!
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      06-04-2004
Laura wrote:
> I have a situation where I want to find two or more words next to
> each other (e.g. "sure thing"). Between those words in the text
> I'm searching there can be just white space OR any number of html
> tags. How do I write a regexp that will identify this?


One approach is to simply remove the HTML first:

perldoc -q "remove HTML"

> I've tried the following, but it doesn't work:
>
> (\\b)(sure\\s+|<\\w*>thing)(\\b)


Err.. Which programming language is that? Since you posted here, I
assumed that you were about to use Perl.

You need to read up on regular expressions in Perl.

perldoc perlretut

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify Incoming Phone Call Krishna ASP .Net 1 12-27-2005 10:41 PM
Identify access point connected to =?Utf-8?B?Q2hhZA==?= Wireless Networking 2 11-03-2005 04:24 AM
pls help identify a certain perl module tom Perl 0 05-24-2005 01:14 PM
How to identify given DLL is WIN32 or .NET assembly? Gnanaprakash Rathinam ASP .Net 2 03-17-2005 10:32 PM
How to identify feature sets? This Old Man Cisco 3 12-05-2003 03:20 AM



Advertisments