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

Discussion in 'Perl' started by Laura, Jun 4, 2004.

  1. Laura

    Laura Guest

    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!
     
    Laura, Jun 4, 2004
    #1
    1. Advertising

  2. 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
     
    Gunnar Hjalmarsson, Jun 5, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replacing a word into other word

    , Aug 23, 2005, in forum: C Programming
    Replies:
    2
    Views:
    301
    Zoran Cutura
    Aug 23, 2005
  2. Etantonio
    Replies:
    0
    Views:
    215
    Etantonio
    Oct 29, 2008
  3. Replies:
    0
    Views:
    118
  4. Replies:
    5
    Views:
    358
    Julian Turner
    Jun 26, 2007
  5. Ferrous Cranus
    Replies:
    88
    Views:
    522
    Dave Angel
    Jan 23, 2013
Loading...

Share This Page