|
In a few seconds on Google I came up with loads of sites about using regex. Instead of keep posting questions about how to use it (I think this is the third or fourth) try looking for yourself.
This is a good starting point ^
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yes, you're right.
I actually made a sample program that will extract the "MyNameHere" using the Regular Expressions like this - (?<name>\w+?)
But I don't why isn't getting the value "MyNameHere"
Please check my code below. Thanks
Dim s As String = "<td class="" fieldlabel="" style="" width:="" 150px;="" valign="" top=""> " _
& "Employee Name</td> " _
& "<td class="" fieldvalue=""> " _
& "MyNameHere" _
& "</td> "
Dim r As Regex
Dim m As Match
Dim sPattern As String = "^<td\ class="" fieldlabel="" \="" style="" width:\="" 150px;="" valign="" top="">\nEmployee\ Name\ \n<td\ class="" fieldvalue="">\ \n(?<name>\w+?)\n\ $"
r = New Regex(sPattern, RegexOptions.IgnoreCase Or RegexOptions.Compiled Or RegexOptions.Multiline)
m = r.Match(s)
While m.Success
TextBox1.Text = m.Groups(1).Value
m = m.NextMatch()
End While
hifiger2004
|
|
|
|
|
I suspect spaces in the wrong place.Why not start with a small expression and build it up, checkuing as you go along? Thats what I would do.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I've set 'setInterval' function to 20sec. (setInterval('alert(1)',20000) ).
Everytime the user clicks a button in the page, a function myFunc() is called and the timer is stoped with clearInterval().
Before the function myFunc() ends, I do setInterval('alert(1)',20000) . The problem is that the timer starts from the begining.
How can I do so the timer continue from the place it stopped. If the timer sopped in 10th second before myFunc() was called, so it will continue from 10sec when muFunc() ends.
Thank You.
|
|
|
|
|
I am not sure whether JavaScript timer is that much versatile.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
Hi All,
Urgent!..............
I have a webapplication running under IIS6. I am storing username as a session variable. When I login and parallelly another user login, I am getting other user's session. If I print username from session variable , I am getting another user's username.
|
|
|
|
|
did you define some static functions for loggin in?
|
|
|
|
|
hello everybody!
I need some help reagarding the javascript!
I have a some text in text feild and i want to convert that text into any one image file (e.g. jpg, gif , png , etc etc)
I have option to use the javascript or DHTML or if there is anyother solution that i can incorporate in simple HTML then please tell me as well.
Thanks in Advance!
Qasim
|
|
|
|
|
You're dreaming. No way is javascript going to create a bitmap file for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi Guys,
I tried storing my html code into a string variable but there's an error, so what i did is just I created test program about storing the a value into a string variable with lots of double quote inside the string.
As you can see below's example, I am trying to store the value (with 6 double quote inside the string) into the "s" variable. But this won't continue the process.
How can I successfully move the value into a string variable? Because I will be using this dynamically in real html codes.
Example:
Dim s As String
s = "<td class="fieldLabel" style="width: 150px; height: 13px;" valign="top">"
hifiger2004
hifiger2004
|
|
|
|
|
This is an ASP.NET question, right ?
Use single quotes, they work fine. Better yet, don't use ASP.NET as if it were ASP. Building HTML by string mashing is nasty, ugly and a sin.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear all,
i have used itextSharp in C# web application to convert into PDF.The basic things are working for me.While adding textboxes by using Agrofields im getting the error.Below is the code ,
PdfStamper formfiller =null;
formFiller = new PdfStamper(reader, pdfOutputFile);
AcroFields acro = formfiller.AcroFields;
acro.SetField=(("User Name"), username);
acro.SetField("NewAddress", password);
formfiller.FormFlattening=true;
check the above code and reply me ,
Dhilip
Dhilip.K.K.
|
|
|
|
|
Let's see
1 - you're asking in the web dev forum instead of ASP.NET
2 - you're asking about a third party library that most of us do not use
Try the iTextSharp support forums.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Im just developing mini project using HTML and JavaScript. Find my code below.. The "window.location.href" is not working..
<html>
<head>
<title>My Login</title>
<script type="text/javascript">
function Validate()
{
if(document.getElementById("txtUserName").value == "")
{
alert("Enter User Name");
document.getElementById("txtUserName").focus();
return false;
}
if(document.getElementById("txtPwd").value == "")
{
alert("Enter Password");
document.getElementById("txtPwd").focus();
return false;
}
if((document.getElementById("txtUserName").value == "Bhuvana") && (document.getElementById("txtPwd").value == "Bhuvana123"))
{
form.submit;
window.location.href="loginTest.htm";
//window.open("loginTest.htm", target="_self")
//return true;
}
else
{
alert("Login Failed");
document.getElementById("txtUserName").value="";
document.getElementById("txtPwd").value="";
document.getElementById("txtUserName").focus();
return false;
}
}
</script>
</head>
<body>
<FORM METHOD=POST>
<table align=center border=1 width="60%">
<tr>
<td align=center>
<br><br>
User Name :
<INPUT NAME="CONTROL1" TYPE=TEXT ID=txtUserName>
<br><br>
Password :
<INPUT TYPE="PASSWORD" NAME="CONTROL2" ID=txtPwd>
<P align=center><INPUT TYPE="SUBMIT" VALUE="Login" onclick="javascript:return Validate();"> <INPUT TYPE="RESET" VALUE="Reset"></P>
<br>
</td>
</tr>
</form>
</body>
</html>
|
|
|
|
|
Im just developing mini project using HTML and JavaScript. Find my code below.. The "window.location.href" is not working..
<html>
<head>
<title>My Login</title>
<script type="text/javascript">
function Validate()
{
if(document.getElementById("txtUserName").value == "")
{
alert("Enter User Name");
document.getElementById("txtUserName").focus();
return false;
}
if(document.getElementById("txtPwd").value == "")
{
alert("Enter Password");
document.getElementById("txtPwd").focus();
return false;
}
if((document.getElementById("txtUserName").value == "Bhuvana") && (document.getElementById("txtPwd").value == "Bhuvana123"))
{
//form.submit;
window.location.href="loginTest.htm";
//window.open("loginTest.htm", target="_self")
//return true;
}
else
{
alert("Login Failed");
document.getElementById("txtUserName").value="";
document.getElementById("txtPwd").value="";
document.getElementById("txtUserName").focus();
return false;
}
}
</script>
</head>
<body>
<FORM METHOD=GET>
<table align=center border=1 width="60%">
<tr>
<td align=center>
<br><br>
User Name :
<INPUT NAME="CONTROL1" TYPE=TEXT ID=txtUserName>
<br><br>
Password :
<INPUT TYPE="PASSWORD" NAME="CONTROL2" ID=txtPwd>
<P align=center><INPUT TYPE="SUBMIT" VALUE="Login" onclick="javascript:return Validate();"> <INPUT TYPE="RESET" VALUE="Reset"></P>
<br>
</td>
</tr>
</form>
</body>
</html>
|
|
|
|
|
Im just developing mini project using HTML and JavaScript. Find my code below.. The "window.location.href" is not working..
<html>
<head>
<title>My Login</title>
<script type="text/javascript">
function Validate()
{
if(document.getElementById("txtUserName").value == "")
{
alert("Enter User Name");
document.getElementById("txtUserName").focus();
return false;
}
if(document.getElementById("txtPwd").value == "")
{
alert("Enter Password");
document.getElementById("txtPwd").focus();
return false;
}
if((document.getElementById("txtUserName").value == "Bhuvana") && (document.getElementById("txtPwd").value == "Bhuvana123"))
{
//form.submit;
window.location.href="loginTest.htm";
//window.open("loginTest.htm", target="_self")
//return true;
}
else
{
alert("Login Failed");
document.getElementById("txtUserName").value="";
document.getElementById("txtPwd").value="";
document.getElementById("txtUserName").focus();
return false;
}
}
</script>
</head>
<body>
<FORM METHOD=GET>
<table align=center border=1 width="60%">
<tr>
<td align=center>
<br><br>
User Name :
<INPUT NAME="CONTROL1" TYPE=TEXT ID=txtUserName>
<br><br>
Password :
<INPUT TYPE="PASSWORD" NAME="CONTROL2" ID=txtPwd>
<P align=center><INPUT TYPE="SUBMIT" VALUE="Login" onclick="javascript:return Validate();"> <INPUT TYPE="RESET" VALUE="Reset"></P>
<br>
</td>
</tr>
</form>
</body>
</html>
|
|
|
|
|
If you only make minor changes in the code, and noone has replied yet, just edit your original post.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
What do you mean by "not working"?
You could try using window.location= instead of window.location.href= .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guys,
I am using ASP.Net and just new to Regular Expression.
I am having difficulty pulling out the value for "Your Payment:" which is "300.00".
How can I get the "Your Payment:" and the "300.00"?
<tr>
<td class="fieldLabel" style="width: 150px; height: 13px;" valign="top">
Your Payment:
</td>
<td class="fieldValue" style="height: 13px">
300.00
</td>
</tr>
hifiger2004
|
|
|
|
|
How about having an
<asp:label runat="server">
and then filling the value for this from serverside?
Note: This is an ASP.NET question. Please ensure that your future Qs are posted in the appropriate discussion forum.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
For oft, when on my couch I lie
In vacant or in pensive mood,
They flash upon that inward eye
Which is the bliss of solitude;
And then my heart with pleasure fills,
And dances with the daffodils. --William Wordsworth ("Daffodils")
|
|
|
|
|
I need to get the value from our second party webpage and do some process there using the regular expression, and after that, the value that I've got from the second party page will be saved into database.
It just like viewing some webpage and when right-click on it and viewing the source, all you can see here is html source code. And if I will not use regular expression when parsing a particular string value then it is more difficult.
Because in regular expression as long as you will know the pattern and if you are very familiar to regex then it will make easier to parse the text value we want. But the thing is I don't know how to do it. This is my first time doing Regular Expression in ASP.Net
hifiger2004
|
|
|
|
|
|
Hi Guys,
Have you encountered this kind of error below? The error is pointing on
line 73. I think it refers to "Regex". I actually wanted to parse some value from the html source file using the Regular Expression.
Where can I download a complete sample source of Regex using ASP.net?
By the way, I am using ASP.Net 2.0 VB code behind.
Thanks,
Hifiger
Server Error in '/RegularExpression' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30057: Too many arguments to 'Public Sub New()'.
Source Error:
Line 72: Dim match1 As Match
Line 73: r = New Regex("<strong>(?<item>.*)</strong></th>", RegexOptions.IgnoreCase Or RegexOptions.Compiled)
Line 74: match1 = r.Match(myString)
hifiger2004
|
|
|
|
|
How many aruguments does intellisense show fro a new regex? That shoudl give you the clue you need.
Google will give you loads of regex samples.
Bob
Ashfield Consultants Ltd
|
|
|
|