Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 572575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:37:37+00:00 2026-05-13T13:37:37+00:00

I use webBrowser.DocumentText to get the html code of a page. using Regex, i

  • 0

I use webBrowser.DocumentText to get the html code of a page.
using Regex, i manage to get the script tag part.
< script type=”text/javascript”>functions here..< /script>

I need to get functions inside those tags.
ex.

<script type="text/javascript">
 function function1 () { code here;}
 function function2 () { code here;} 
<br>
</script>

I need regex pattern to get the 2 functions
or list them down like this
1. function funtion1() { code here; }
2. function funtion2() { code here; }

purpose of the program is to identify if there’s a duplicate javascript functions between
2 pages.

Its for winForms and language is C#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:37:38+00:00Added an answer on May 13, 2026 at 1:37 pm

    You can not do it in any general way with regexes alone (especially not with the .NET flavour), since JavaScript scopes can be nested arbitrarily deeply and the language is therefore irregular. If you need them for a few particular pages, you might be able to craft a regex that handles common cases, but not all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use WebBrowser control to load some localfile html page. I am
As the WebBrowser control does not expose a get accessor for the DocumentText property
When you use the WebBrowser control in .NET you can embed an instance of
Currently I use .Net WebBrowser.Document.Images() to do this. It requires the Webrowser to load
Use case: 3rd party application wants to programatically monitor a text file being generated
I'm using a winforms webbrowser control to display some content in a windows forms
Here's my scenario: I'm using the WebBrowser control in a WinForms app to display
I have a .NET 2.0 app (using C#) that shows some dynamically constructed HTML
I want to use the Web Browser control within an mono application, but when
In Windows, in any windows form or web browser, you can use the tab

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.