How can i use regular expression search in TextRange Object?

Discussion in 'Javascript' started by ocomet@gmail.com, May 31, 2005.

  1. Guest

    Hi Everyone..

    I want to know how can I use regular expression in TextRange Object.

    I wrote specific word highlighting code and it is working now.
    but this is static word highlighting.

    I want to emplement dynamic word highlighting using regular
    expression..

    I want your advice..

    thanks. regards..
     
    , May 31, 2005
    #1
    1. Advertising

  2. Ivo Guest

    <> wrote
    > I want to know how can I use regular expression in TextRange Object.
    >
    > I wrote specific word highlighting code and it is working now.
    > but this is static word highlighting.
    >
    > I want to emplement dynamic word highlighting using regular
    > expression.


    Not sure what you mean. Regular expressions work on strings of text,
    regardless of the origin or nature of that text. It may come from a
    TextRange(), from a paragraph element, a user prompt, it doesn't make a
    single difference.

    The regex can itself be dynaically constructed using the RegExp object, or
    it can be a static literal, spelled out in the script, but again, once
    constructed, there is no difference and the procedure and results are all
    the same.

    hth
    Ivo
    http://4umi.com/web/javascript/
     
    Ivo, May 31, 2005
    #2
    1. Advertising

  3. wrote:
    > I want to know how can I use regular expression in TextRange Object.


    You may use a range's toString method to get the text of the range. You
    may than us your regExp with that string.

    Daniel
     
    Daniel Kirsch, Jun 1, 2005
    #3
  4. wrote:

    > [...]
    > I want to know how can I use regular expression in TextRange Object.
    >
    > I wrote specific word highlighting code and it is working now.
    > but this is static word highlighting.
    >
    > I want to emplement dynamic word highlighting using regular
    > expression..
    >
    > I want your advice..


    I want popcorn.


    PointedEars
    --
    There are two possibilities: Either we are alone in the
    universe or we are not. Both are equally terrifying.
    -- Arthur C. Clarke
     
    Thomas 'PointedEars' Lahn, Jun 6, 2005
    #4
    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. VSK
    Replies:
    2
    Views:
    2,305
  2. Rom

    textrange and iframes

    Rom, Jul 15, 2003, in forum: Javascript
    Replies:
    0
    Views:
    96
  3. Replies:
    6
    Views:
    101
  4. Peter Hanke
    Replies:
    1
    Views:
    149
    Dr.Ruud
    Jan 6, 2008
  5. gm1974

    from caret to textRange object

    gm1974, May 11, 2005, in forum: Javascript
    Replies:
    1
    Views:
    92
    Baconbutty
    May 11, 2005
Loading...

Share This Page