Regex In 2005 For Case Insensitive Registry Search

Dec 15, 2009

I've recently learnt that Regex class maybe used to develop case insensitive searches. I have a registry search program that will return only the exact matches from the registry. I need to make it case insensitive. how to do that using regular expressions in vb.net 2005. Im posting my code below:

Sub SearchSubKeys(ByVal root As RegistryKey, ByVal searchKey As String)
Dim matchtype As String = Nothing
Dim str(5) As String

[Code].....

View 5 Replies


ADVERTISEMENT

Case Sensitive/insensitive Search Text In A String?

Sep 8, 2010

I've been using text.indexof() to see if a string is located inside another string, however is it it possible to do a case sensitive/insensitive search option? I've been looking around Google and not having much luck with it.

A huge bonus would be if it could count the number of occurrences inside the string!

View 1 Replies

Case Insensitive Contains Method

Oct 29, 2009

I am using the contains method to look through an array to find matches, however I notice that when I use it it is case sensitive. Is there another method I can use to do a case insensitive search or some way to modify the contains method to search case insensitively? [code]

View 3 Replies

Get Filenames Case Insensitive?

Sep 9, 2011

I am using this code to get a list of files in a folder:

Dim files() As String = (From file In New IO.DirectoryInfo(myFolder).GetFiles Where file.Extension = ".exe" Select file.Name).ToArray

This works fine, but the problem is that it selects only files with the extension of "exe" & skips files that have an "EXE" extension. Is there any way to make it case-insensitive, to make it return any combination of upper/lower case letters in the extension?

View 2 Replies

How To Make WPF Case-insensitive

Jul 21, 2010

I dislike WPF's inability to interpret text in a case-insensitive way.Are there any tools (i.e. VS plugins) out there that will take my VB .NET code and handle the case-sensitivity issues for me?Edit: Now with examples.

Input:

<Dockpanel DockPanel.Dock="Bottom">
<Label Content="(c) blahblah" HorizontalAlignment="Left" Name="Label2" VerticalAlignment="Bottom" Opacity=".75" Background="White" DockPanel.Dock="bottom"/>
</DockPanel>

Output:

<DockPanel DockPanel.Dock="Bottom">
<Label Content="(c) blahblah" HorizontalAlignment="Left" Name="Label2" VerticalAlignment="Bottom" Opacity=".75" Background="White" DockPanel.Dock="Bottom"/>
</DockPanel>

View 2 Replies

C# - Case-sensitive Vs Insensitive Languages?

Nov 28, 2010

visual basic.net is case insensitive so it allows the coder to write without caring or remembering the casing of variables. it also relieves from the 'undeclared variable' errors if you use the variable in another case than the one used in declaration. The fact that its line termination is a line feed makes it even more readable unlike C# or c++ that need good care in the casing and contineous war with following up with the {}, matching them and figuring out which is for which.

my question is what are the advantages of c# over vb knowing that both get compiled to MSIL so there is almost no performance difference between the two languages?

View 4 Replies

Case Insensitive Dictionary Not Working?

Jun 15, 2011

I have spend a couple of hours trying to figure out why my generic Dictionary(Of String, String) is not ignoring case.Here is my code:

Dim test As New System.Collections.Generic.Dictionary(Of String, String)(System.StringComparison.OrdinalIgnoreCase)
test.Add("FROG", "1")

[code].....

View 1 Replies

Case Insensitive Web Reference Enumeration

Apr 15, 2012

I created a Web Reference (also tried Service Reference) to a WSDL that had the following node inside an xsd:
<xs:element name="filter">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element minOccurs="0" maxOccurs="unbounded" ref="condition" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="filter" />
[Code] .....

This wouldn't build in a VB project because VB.NET is case insensitive. I tried deleting one set of and/or, but when the XML is created, it simply ignores the selected value. I also tried appending an X at the end of one the sets which also failed. Is there a way to make this work? I also tried updating the XSD so it just had two values without success. The interesting thing to note is that default is set to "and" and while debugging it will set it to and, it doesn't actually produce the node attribute of it just generates.

View 1 Replies

Create A Case-Insensitive TextBox?

Feb 27, 2009

I have a TextBox that need to be case-insensitive. For example, I have this. If searchTextBox.Text = "Park" Then... I need results back if "Park" is typed or "park".

View 6 Replies

Overcome XML Case Sensitive - Insensitive?

Jan 6, 2012

I have a project to read xml files. It comes from a web service. But it can come sometimes with different attributes.

The standart xml file is like this:
<xml ....>
<car carname="Opel">Opel

[code].....

View 2 Replies

Process Name Check Needs To Be Case Insensitive

Oct 25, 2009

I put this at the top of my project:
Option Compare Text

Here is the sub that contains the process name check:
Sub AC3()
Dim ProcessList As System.Diagnostics.Process()
ProcessList = System.Diagnostics.Process.GetProcesses()
Dim Proc As System.Diagnostics.Process
For Each Proc In ProcessList
[Code] .....

No errors, but it only checks the lowercase hack/cheat/inject. I need it to be case insensitive when checking it.

Figured it out and tested and it works. I put, right after dim procname...
procname = procname.ToLower()
works great.

View 1 Replies

Using String.Contains With Case-insensitive Arguments?

Dec 8, 2006

Is there any way to use Dim Str as String = "UPPERlower"Str.Contains("UpperLower") and have it return true?

View 5 Replies

.net - Case Insensitive String Compare In LINQ-to-SQL

May 8, 2009

I've read that it's unwise to use ToUpper and ToLower to perform case-insensitive string comparisons, but I see no alternative when it comes to LINQ-to-SQL. The ignoreCase and CompareOptions arguments of String.Compare are ignored by LINQ-to-SQL (if you're using a case-sensitive database, you get a case-sensitive comparison even if you ask for a case-insensitive comparison). Is ToLower or ToUpper the best option here? Is one better than the other? I thought I read somewhere that ToUpper was better, but I don't know if that applies here. (I'm doing a lot of code reviews and everyone is using ToLower.)

[Code]....

View 6 Replies

Array.FindAll Case Insensitive Strings?

Dec 27, 2011

I am working on a program for a client and will need a feature to search for strings from an array without case sensitivity. This currently works, but it is case sensitive. I commented out the code for readability.

' Declare array for goldSmithingExpertise and add items.
Dim goldsmithingExpertise() As String = {"Alluring Earrings", "Alluring Ring", "Alluring Belt", "Howling Staff", "Dawn Ring", _
"Melancholy Earrings", "Melancholy Belt", "Melancholy Ring", "Jubilant Ring", "Jubilant Earrings", _

[code]....

View 4 Replies

VS 2010 List.Contains Case-insensitive Lookup

May 29, 2012

If I have a list of filenames in a list, how can I do a case-insensitive lookup?

Dim files As List(Of String) = IO.Directory.GetFiles(myFolder).ToList
If files.Contains(myFileName) Then
'do something
End If

The above snippet will only do a case sensitive search.

View 5 Replies

Filter By File Extension - Check For .jpg .gif .png All Case Insensitive?

Jun 10, 2009

I am searching through files and only want to include files with certain extensions. Right now I have what is below but it would be stupid to do it that way for 3 or more file types and it isn't completely case insensitive.

If ext = ".jpg" Or ext = ".JPG" Then

I want to check for .jpg .gif .png all case insensitive.

View 11 Replies

Ignoring Hyphen In Case Insensitive Dictionary Keys?

May 31, 2012

I have a case insensitive dictionary in asp.net/vb.net like this:

Dim caseInsensitiveDictionary = New Dictionary(Of String, Single)(StringComparer.OrdinalIgnoreCase)
it holds values like this

[code].....

View 2 Replies

Linq Join On Parameterized Distinct Key CASE INSENSITIVE?

Oct 7, 2010

To revisit a previous question with a further stipulation..Anyone know how to do the following, IGNORING CASE?

[Code]...

View 3 Replies

VS 2008 Unable To Do A Case-insensitive Query On A Table?

Jul 13, 2009

I'm having trouble when trying to do a case-insensitive query on a table. Right now the query is:

txtQuery = "SELECT Status, RankingSearchEngines FROM [tbl-DATA-Client-Keywords] WHERE [Client-ID-Code] = '" & clientNo & "' AND lower(Keyword) LIKE '" & sField(0) & "';"

The actual query executed is:

SELECT Status, RankingSearchEngines FROM [tbl-DATA-Client-Keywords] WHERE [Client-ID-Code] = '1402' AND lower(Keyword) LIKE 'flyer printing';

I have an entry 'Flyer Printing' in the database, and this query works perfectly without the case-insensitive check.I'm not sure if this is an OleDB issue, as I've never had this sort of problem with SQLPlus, or anything else

The exception being thrown is:

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

View 4 Replies

Case-sensitive Languages Vs Insensitive Languages?

Nov 27, 2010

visual basic.net is case insensitive so it allows the coder to write without caring or remembering the casing of variables. it also relieves from the 'undeclared variable' errors if you use the variable in another case than the one used in declaration. The fact that its line termination is a line feed makes it even more readable unlike C# or c++ that need good care in the casing and contineous war with following up with the {}, matching them and figuring out which is for which.my question is what are the advantages of c# over vb knowing that both get compiled to MSIL so there is almost no performance difference between the two languages?

View 1 Replies

VS 2008 Regex Replace Upper Case?

Feb 4, 2010

For example, I want to match <Tag or <TAG and replace to <tag

Here's what I did(which obviously did not work): tmp = Regex.Replace(tmp, "<(.*)", LCase("$1"))

Just wondering what are some good ways to do this?

View 8 Replies

Get A Regex Search To Search For The URL Of An Image?

Aug 24, 2010

how i would get a Regex search to search for the URL of an Image (i know the first half of the URL but the rest needs to be searched for as it changes) in a WebBrowser control?

View 2 Replies

VS 2008 - Ignore Case In Search Function

Jul 11, 2009

I am having problums with Ignore Case in searching. I got a checked listview and a listbox, it searches and fines just the exact word.
For i As Integer = 0 To (Me.Special_Search_Histroy_CheckedListview.CheckedItems.Count - 1)
'Dim itemString As String = Me.Load_Search_name_Listbox.Items(item).ToString
Dim strr As String = (Me.Special_Search_TextBox.Text)
Dim path As String = (Me.Special_Search_Histroy_CheckedListview.CheckedItems.Item(i).SubItems(0).Text)
Dim readText() As String = File.ReadAllLines(path.ToString)
[Code] .....

View 5 Replies

Forms :: RichTextBox - Search Feature And Match Case

Mar 28, 2011

Here's the situation: I've got a form that has
- RichTextBox
- OpenButton (to load RTF file)
- SaveButton (to save RTF file after editing)
- Textbox (for search phrase)
- SearchButton
- ExitButton
- 2 RadioButtons (WholeWord and MatchCase search)

All of them are working just the way I want them to except search features; I don't know how to write them properly. At the moment, they search and highlight only the first word they encounter. E.g. say I search for word "the" in the document, only the first "the" it encounters is highlighted. The rest is just untouched.

I understand this is because I've only got few lines of simple code as follows
If rtfText.Find(txtSearch.Text, RichTextBoxFinds.WholeWord) = -1 Then
MessageBox.Show("No results returned. Please try again.", "No matching results.", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

I did try a few other snippets I found on the Internet including While loop but they didn't work as I wanted them to, and I couldn't understand them either. What I want is, which ever search option is used, when the matching result is found; it will highlight that word and when I click it again it will move onto another word. If I keep clicking, it will highlight the same words (but located in different areas) throughout the whole document and at the end, it will send back to the first matching word. Just like Adobe Reader search.

View 4 Replies

Using Regex To Search For 4 Letter Words?

Jan 4, 2010

I have a textbox with a large amount of data, but I am trying to extract only the following into an array: only 3 or 4 letter, uppercase words. The goal is to find all stock symbols within a document.

For example, in this post, if I were to type "MSFT", regex would extract MSFT because it is a 4 letter, uppercase word.

View 15 Replies

Search For Registry Key By Value?

Sep 7, 2009

how can i search for registry key by value using vb.net? when an application is published in the client system, the application setup is stored in a particular path which can be changes by the client whcih will check for updates when a new patch is released. The registry hold the application path. How can i dynamically get the registry key by giving the value using vb.net??The value is known, is it possible to specify the value in the registry and search for the Key using VB.net?

View 2 Replies

VS 2008 Regex - Parse Out Some Links Via Search And Fill A Text Box With Said Results

Mar 25, 2009

What I'm trying to do is parse out some links via a google search and fill a text box with said results. This is the code I have in a module which I call upon inside of a command button.

Imports System.Text
Imports System.Text.RegularExpressions

Module Module1

[CODE]...

View 8 Replies

File I/O And Registry :: Use VB To Search A XML Document?

Oct 3, 2008

I want to only get the values of "Relation1 relationship" and "Relation1 Name". So using the example I would retreive "Father" and "John". How do I use VB 2008 Express Edition to accomplish this? Below is the sample XML document.

Code:
<ANSWER>
- <ANSWER ID="Phone Number">
<VALUE>123-123-1234</VALUE>
</ANSWER>

[code]....

View 1 Replies

File I/O And Registry :: Find File Name Regardless Of Extension's Case?

Sep 15, 2009

I need to be able to find files in a folder where the extension can be either caps or small letters. Here's my code:

Code:
Public Function GetIcon(ByVal name As String) As Icon
Dim execAssembly As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly
Dim stream As System.IO.Stream =

[Code]....

How can I modify that function to return the file regardless of whether the extension is in caps or small letters?

This is in VS2005 for a .NET 2.0 Compact Framework project

View 2 Replies

VS 2005 Delegates Instead Of Select Case?

Aug 4, 2009

I think I have read somewhere that delegates could be used in place of Select Case but I cannot find anymore that article. Could anyone confirm and provide some sample if this is true?I've only used delegates in threading and I have been heavily using Select Case and thought I could try using delegates instead.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved