Click here to Skip to main content
15,903,715 members
Home / Discussions / C#
   

C#

 
AnswerRe: Try {//code} catch{throw;} ? Pin
LobsterDK9-Aug-05 6:39
LobsterDK9-Aug-05 6:39 
GeneralUnable to programmatically add certificate to certificate store Pin
shubc9-Aug-05 3:56
shubc9-Aug-05 3:56 
Generalpls suggest solution for linking error between pocket pc and printer through infrared(IR) Pin
intractive9-Aug-05 3:39
intractive9-Aug-05 3:39 
GeneralRe: pls suggest solution for linking error between pocket pc and printer through infrared(IR) Pin
Dave Kreskowiak9-Aug-05 5:18
mveDave Kreskowiak9-Aug-05 5:18 
GeneralInstance of Pin
zaboboa9-Aug-05 3:34
zaboboa9-Aug-05 3:34 
GeneralRe: Instance of Pin
J4amieC9-Aug-05 3:52
J4amieC9-Aug-05 3:52 
GeneralRe: Instance of Pin
zaboboa9-Aug-05 4:08
zaboboa9-Aug-05 4:08 
GeneralRegex fun! Pin
Hauxon9-Aug-05 3:01
Hauxon9-Aug-05 3:01 
Hi I'm having a little problem with .NET Regex. I'm using Regex to find included javascript and CSS files in a HTML page and want to put their content directly to my page (because I'm disabling some JS methods for security).

Here's my non working code:
<br />
string html = "content of the webpage";<br />
String jsFilePattern = "(?<firstpart><script\\s* [\\w \\s = \" ' / \\. & ?]+) src=\" (?<jsurl> [\\w \\s = \" ' / \\. & ?]+) [\" '] (?<lastpart> [\\w \\s = \" ' / \\. & ?]+>) ";<br />
Regex r = new Regex(jsFilePattern, RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnoreWhitespace);<br />
html = rReplace(html, "${firstpart} ${lastpart}" + ReadFromFile("${jsurl}"));


You don't need to debug the pattern for me because I've tested it and it works. My problem is when I call the function ReadFromFile (witch reads data from a file and returns it's contents as a string) from the Regex the content of the parameter ${jsurl} is not put in the function but the parametername instead (${jsurl}. This results in an error from my ReadFromFile funtion. It seems like Regex puts the contents of it's parameters afterwards.

Is there another way to do this?... Can I use my precious Regex pattern somehow to collect the $jsurl parts into an array or something??

Thans for reading this far Smile | :)
Hrannar
GeneralRe: Regex fun! Pin
Guffa9-Aug-05 4:35
Guffa9-Aug-05 4:35 
GeneralRe: Regex fun! Pin
Hauxon9-Aug-05 5:35
Hauxon9-Aug-05 5:35 
GeneralRe: Regex fun! Pin
Guffa9-Aug-05 5:46
Guffa9-Aug-05 5:46 
GeneralQuestion about returning a Structure as string (ToString) Pin
MaWeRic9-Aug-05 2:46
MaWeRic9-Aug-05 2:46 
GeneralRe: Question about returning a Structure as string (ToString) Pin
Guffa9-Aug-05 4:41
Guffa9-Aug-05 4:41 
GeneralRe: Question about returning a Structure as string (ToString) Pin
MaWeRic9-Aug-05 5:15
MaWeRic9-Aug-05 5:15 
GeneralInsert Text Pin
David_cole9-Aug-05 2:26
David_cole9-Aug-05 2:26 
GeneralRe: Insert Text Pin
Mohamad Al Husseiny9-Aug-05 13:15
Mohamad Al Husseiny9-Aug-05 13:15 
GeneralUnhooking the event Pin
zaboboa9-Aug-05 2:05
zaboboa9-Aug-05 2:05 
GeneralRe: Unhooking the event Pin
Mohamad Al Husseiny9-Aug-05 2:22
Mohamad Al Husseiny9-Aug-05 2:22 
GeneralDataGrid AllowSorting problem Pin
kalliet9-Aug-05 1:37
kalliet9-Aug-05 1:37 
GeneralRe: DataGrid AllowSorting problem Pin
kalliet9-Aug-05 2:19
kalliet9-Aug-05 2:19 
QuestionHow to get path of MDF file and LDF file of a database programmetically? Pin
pubududilena9-Aug-05 1:29
pubududilena9-Aug-05 1:29 
AnswerRe: How to get path of MDF file and LDF file of a database programmetically? Pin
Alomgir Miah9-Aug-05 3:54
Alomgir Miah9-Aug-05 3:54 
Generaldepoly project Pin
Mikel Fayad9-Aug-05 1:22
Mikel Fayad9-Aug-05 1:22 
GeneralRe: depoly project Pin
Mohamad Al Husseiny9-Aug-05 2:16
Mohamad Al Husseiny9-Aug-05 2:16 
GeneralRe: depoly project Pin
Alomgir Miah9-Aug-05 3:57
Alomgir Miah9-Aug-05 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.