Code Reapet The First Regex Condition?
Aug 14, 2011
wrote a program with Regex condition but it shows me Twice the first condition (<H1>Welcome to my Homepage</H1>)what is my problem?i enable multiline property of Textbox1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim l As New Regex("<(H1|H2)>.*?</(H1|H2)>")
[code].....
View 2 Replies
ADVERTISEMENT
Apr 28, 2012
When two computers are connected through TCP, and one of them closes and breaks the connection, it throws error 10054 "Remote host forcibly closed the connection".I want to handle this error because I know it will happen more often than not with the application I'm building. In System.Net.Sockets.SocketException, there is an on the error code. But when I run the program, the exception that is being thrown is System.IO.IOException, and the GetType for IOException is the socket exception. I don't know how to handle the socket exception if it's not the root cause of the exception.
Here is the code for my Try Catch block:
For infiniteCounter = 1 To 2
infiniteCounter = 1
[code].....
View 2 Replies
Feb 10, 2011
I have a form called LogIn.vb which has no errors. After log-in, it opens the MainForm.vb which IsMDIContainer property is set to true. From the MainMenu, it opens a child form called Assure_Benefits.vb So far no problem up to this point. When Assure_Benefits.vb loads, it displays 2 DataGridViews with datasourses from my 2 tables in my database.
There is still no problem with the loading. Now, to show the difference between different user types, I only allow the admin to edit the DataGrid. SO I set the readonly property to true when UserType = "user".
I have no problem doing that. My problem is I want to add some codes besides the readonly being set to true and false but other codes are not executed and the program does not display any errors at all. i tried to add messageboxes on the if and else conditions to try if added codes will work but even the messagebox does not appear though the codes next to it are properly executed.
When my Assure_Benefits.vb loads I call for the subroutine below.
Private Sub SetControlProperties()
If LogIn.UserType = "admin" Then
MessageBox.Show("Yes") 'This line is not executed
[CODE]...
I can't seem to understand why the first code is not executed when the next codes works fine.
View 5 Replies
Apr 2, 2009
I have written a short piece of code to validate a UK NI number. The format is 2 upper case letters, followed by 6 digits followed by A,B, C or D. This code does not work, it never matches even when the string NI_Num is OK: [code]
View 2 Replies
Jul 10, 2009
I must admit it's been a few years since my RegEx class and since then, I have done little with them. So I turn to the brain power of SO. . . I have an Excel spreadsheet (2007) with some data. I want to search one of the columns for a pattern (here's the RegEx part). When I find a match I want to copy a portion of the found match to another column in the same row.
[Code]...
View 3 Replies
Apr 4, 2011
what would the regEX code be for the following:
<br/><span class=""synopsis-view-synopsis"">America's justice system comes under indictment in director <a href='/people/1035' class='actor' style='font-weight:bold'>Norman Jewison</a>'s trenchant film starring <a href='/people/1028'
[code].....
View 3 Replies
Dec 28, 2011
I'm using this code
[Code]...
I need it to match both 12345 (5 char zip) and 12345-1234 (10 char zip) in 1 single group. Is that possible?
[Code]...
View 1 Replies
Jan 13, 2010
Yes, I've googled. But I must defer to the experts as time to study Regex is not available.
[Code]...
Can these 3 lines be condensed into one line? If so, how? The purpose is to remove all spaces before and after all occurrences of & in a string.
View 3 Replies
Apr 15, 2010
I am not sure about the semantic of "ApplicationDirectory" membership condition. I am trying to use it in the .NET Framework 2.0 configuration tool. The tool's explanation to it is as below:
The Application Directory membership condition is true for all assemblies in the same directory or in a child directory of the running application. Assemblies that meet this membership condition will be granted the permissions associated with this code group.All the other membership conditions such as strong name, hash, allow me to input some criterias, only the Application Directory has not. So how to use it?
View 2 Replies
Apr 5, 2012
I am having an issue where I am using regex.Replace to replace part of a string. The basic idea is that I want to capture the beginning of the string then replace the end of the string with a value from code. For an example pretend I have a string that says "Test Number " followed by number and I want to increment that number. I capture the "Test Number " but when I try to concatenate that capture with the new number it treats the capture ($1) as a literal and replaces the entire string with $1[new number].
[code]...
This will output "We are on Test Number 2", as expected. how I can use a variable in the replacement string portion of the Regex.Replace when including a captured group?
View 1 Replies
Feb 23, 2012
I want to take the text and some special characters between the xml tags.. My input file contains:
[Code]...
now i want the Regex to take text and the special characters between the tags <line>,<inline>..
View 2 Replies
Jun 21, 2012
I'm creating a program in VB.NET to output multiple images. Some images will have the same file name. If there is multiple files with the same name I want to add "_1_" to the end of the file name. If the "_1_" file already exists I want to increment the 1 to be "_2_". If this file already exists I want to continue incrementing the number ultil it doesn't exist. So for example "filename", filename_1_", "filename_2_", etc. Here is the code that I have tried
[Code]...
View 1 Replies
Nov 17, 2011
I've been working straight since yesterday trying to get this to work. I'm a noob to RegEx and I've tested out about 5 different RegEx "builders" but each of them require you to navigate through the options to build the Regex...each of them has failed when I try to use them.Is there an application out there free/paid where you select the line you want to grab and the RegEx is auto generated from that highlight rather than having to try to build the line of code? [code]
View 1 Replies
Feb 16, 2011
I am trying save a value from an input tag in some HTML source code. The tag looks like so:
<input name="user_status" value="3" />
I have the page source in a variable (pageSourceCode), and need to work out some regex to get the value (3 in this example). I have this so far: [Code] Which works fine most of the time, however this code is used to process source code from multiple sites (that use the same platform), and sometimes there are other attributes included in the input tag, or they are in a different order, eg:
<input class="someclass" type="hidden" value="3" name="user_status" />
I just dont understand regex enough to cope with these situations.
View 2 Replies
Nov 16, 2011
Here is the current regex
"src=[""'](http://|./|/)?w+(.w+)*(/w+(.w+)?)*(/|?w*=w*(&w*=w*)*)?[""']>"
What I am trying to do is to grab element that is:
<script type="text/javascript" src="http://www.mysite="I need to grab everything inside these quotes">
With the current Regex I am able to grab the value but it also grabs all the "src" elements on the page.
src="http://www.mysite="I need to grab everything inside these quotes">
What I am attempting to do is to only get this one line that includes the
<script and then the src="">
And then just get the src="info from hrere" How can I edit the current regex code to include <script type="text/javascript"
View 1 Replies
Mar 5, 2009
I would like to be able to parse vb.net code files, so I can examine the collection of Subs, Functions (and their contents, including comments), private variables, etc. I can be open the actual source code files. So for example, if I have:
[Code]....
View 7 Replies
Aug 10, 2011
i mean for e.g., numbers are between 1 and 100 .i want to show messagebox for each number as text for example "One" for 1.
View 1 Replies
Oct 18, 2010
I had posted this question before but didn't get the right answer -here's my code again with the if condition.
Dim provider As CultureInfo = CultureInfo.InvariantCulture
Dim a1 As DateTime = Nothing
If date1.selectedvalue isnot nothing Then
[code]....
View 4 Replies
Sep 25, 2011
I have a problem. I have been programming an activation type of security protection for my software but i ran into problems when i try to generate an alphanumeric key with conditions. i cant seem to be able to make the keys to be valid with the condition. Basically i can get the 25 keys but all of them seem to be returning 1 (ones) instead of 0 (zero which what i want. below is my sample code may be someone can tell me what i am doing
[Code]...
View 1 Replies
Dec 8, 2009
I have the following code which gives me an error at run time. The problem is when TxtSearch.Text - is not an integer a message box should be prompted saying- Only a numeric value is allowed in this field, otherwise continue with the sub.
Private Sub ButtonSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSearch.Click
Dim query As String
[Code].....
The error I receive is showing ''saved_prac = cmd.ExecuteScalar()''..
First it brings the Message box - Only a numeric value is allowed in this field. When I OK it, then it brings another message box "error converting data type varchar to numeric". When you click OK the application crashes...
View 6 Replies
Jun 20, 2010
What is the correct syntax to go to the next sequence in a loop if certain conditions are met bypassing the contents.
I am using goto and inserting a line number which is probably not the best way.
I.E. My syntax:
For i = 0 to 100
If i = myvariable goto 100
Functions to be performed
[Code]....
View 8 Replies
Nov 15, 2010
When I am click a button every time adding +1 in a textbox but I want to give condition that it will add until the desite is 8 I am using the following code
If e.KeyCode = Keys.Down Then
textbox1.text = Val(textbox1.tex)+ 1
End If
View 2 Replies
Sep 15, 2011
I'm trying to read data from database.
If objReader.Read = True Then
If objReader("cell") IsNot DBNull.Value Then
Me.txtContact.Text = Trim(objReader("cell"))
[code]....
Problem is, no data displays if cell is empty.
View 8 Replies
May 21, 2011
my problem is that i want to put if condition on textbox for example i want if key board keypress on textbox then enter no in textbox
[Code]...
View 9 Replies
Jan 21, 2012
I use a worker thread to do the procedure of query and fill the datasetAnd I use 3rd party component called DevExpress XtraGrid: GridControl to view the query outputI don't forget to use invoke and delegate to set the GridControl.datasourceOn Timer.Tick(), the thread is started and the procedure is called user has scrolled down the GridControl, even only one scroll value instead,and then the Timer.Tick() fired, I gottwo errors randomly. Mostly aNullReferenceException error and eventually anInvalidOperationException error
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateCellAppearance(GridCellInfo
[code].....
View 1 Replies
Aug 16, 2011
Scenario: I need to create a report for the auditors for an ASP.Net application. I have a program that parses the XML of the web.config files in a directory for the authorization tag and creates a report providing which users have access to which folder in the site structure. The report is shown below.
UserName, Firstname, LastName, Directory, Roles, Access,
LastLoginDate
Problem: As you can see from the report some directories (the middle column with GISMO in it) show up twice, with both allow and deny for a user. I am wondering if there is a way to group the results in such a way that if there is a row that has allow for a directory then the deny's are not shown but otherwise they are.
Alternatively if this can be manipulated in VB.net/C# that is also an option. It comes back there and is pumped into an Excel spreadsheet.Edit: I should have explained better. I still need the deny rows to show if the user isn't allowed in the directory. But if they are allowed then there is no point showing the deny rows.
View 4 Replies
May 14, 2010
I am developing an application to my official use. In which I have one combo box for selecting the customerName.When I select the custName from the combobox I want to retrieve data from a particular field of a table and sum it within a selected date value. i.e: When the user selects a custName from the combobox the field within the date value should be summed up and grouped by custName. I think it is possible but I dont know how it is to be done.
View 10 Replies
Jun 16, 2010
I think im going mad but can some show me what im missing, it must be some stupidly simple i just cant see the wood for the trees.BOTH side of this if then else statement are being executed?
Ive tried commenting out the true side and moving the condition to a seperate variable with the same result. However if i explicitly set the condition to 1=0 or 1=1 then the if then statement is operating as i would expect. i.e. only executing one side of the equation...
The only time ive seen this sort of thing is when the compiler has crashed and is no longer compiling (without visible indication that its not) but ive restarted studio with the same results, ive cleaned the solution, built and rebuilt with no change?
Dim dset As DataSet = New DataSet
If (CboCustomers.SelectedValue IsNot Nothing) AndAlso (CboCustomers.SelectedValue <> "") Then
Dim Sql As String = "Select sal.SalesOrderNo As SalesOrder,cus.CustomerName,has.SerialNo,
[code]....
View 4 Replies
Sep 16, 2011
I have one datagridview with first column may contain checkbox or could be empty space depending upon data in second column. How can I put checkbox or keep it empty in first column whever required ? Checkbox column puts check box in all cells of first column.
View 1 Replies
Jul 29, 2010
In aspx page:
if (<%= Not Me.ThisVisa.PassportExpirationDate.IsNull %>){
Returns error:Microsoft JScript runtime error: 'True' is undefined
I tried this:
if ("<%= Me.ThisVisa.PassportExpirationDate.IsNull.ToString %>" != "True"){
..but I get a compile time error:
Error 5 Option Strict On disallows implicit conversions from 'String' to 'Long'
View 4 Replies