Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1

Thread: RegExp how to?

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    8
    Member #
    26480
    I have the current problem. My code looks like this
    "<h1>some text<a href="#">hello</a> some text </h1>" or it could be like this
    "<h1>&nbsp; <a href="#">hello</a></h1> <br> <b>hello</b>"
    Now i want to count all the tags which contains the word 'hello'.
    In this case my count value should be 2 with the first code and 3 with the second but i dont know how to extract this value. I try something like match(new RegExp('<([^>]*)>.*((?!<\\/[^>]*>).)*\\b'+'hello'+'\\b.*<\\/\\1>','gim')) but it didnt work well
    please help

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:18 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com