[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Regex.Match

Posted on 2011-10-12
4
Medium Priority
?
426 Views
Last Modified: 2012-05-12
Hey guys i want to do a match to return my title="TEXT" using regex match

my current regex serach for <Title>TEXT</Ttle>

here the code:

 Match TitleMatch = Regex.Match(fileContents, "<title>([^<]*)</title>", RegexOptions.IgnoreCase | RegexOptions.Multiline);

now i need to change to find the inner text of Title="TEXT"

couse this is aspx page not htlm
0
Comment
Question by:JCWEBHOST
4 Comments
 
LVL 8

Expert Comment

by:guvera
ID: 36955083
Hi,
 
Please check the below links.

  http://forums.asp.net/t/1269203.aspx/1
  http://www.dotnetperls.com/regex-match
  http://www.codeproject.com/KB/dotnet/regextutorial.aspx

Hope it may helpful to you.

Regards
Guvera
0
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 36955090
Try this

Match TitleMatch = Regex.Match(fileContents, "(?<=title=\")[^\"]*", RegexOptions.IgnoreCase | RegexOptions.Multiline);
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36955147
What do you mean by, "now i need to change to find the inner text of Title='TEXT'"?
0
 
LVL 7

Expert Comment

by:dimaj
ID: 36956774
Can't you use XML libraries to extract all the elements?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question