Match 2 Different Strings Together?
Sep 11, 2010My app retrieves "Place names" and their "Addresses" from a website.
View 2 RepliesMy app retrieves "Place names" and their "Addresses" from a website.
View 2 RepliesI would like you to help me out with the strings, which I find it difficulty to get from the html class. The first string I uses as pattern1 string, which it connected to the server to get the showtitle string from the html class, it is working fine. I couldn't be able to get the string on the second paragraph from the html class with pattern2 string, as the text goes on the blank. I need to get the string from the html class. The third pattern string, I am trying to get the string at the end of the html class so I got the blank text.
[Code]...
i am pulling data line by line from a PPML what i need to do is: If "current line" matches my string then write that line to a new file
that part I have down my only issue is, is that the "current line" has filenames with in it that change constently i would like to be able to do something like a string with wildcards in it : "<currentline>src=""*""/>" but this does not seem to work Do i need to do an index with conditions or is there a different way if i do need to do an index how would i go about doing that in vb .net for studio 2008
I am working on my project as I am trying to reads the whole strings in the php page while read the strings from the textbox. When I input 4 matched digit numbers, it displaying the messagebox that says the number is incorrect which it does.[code]I am trying to achieve by read the strings in the php and find the strings if it matched with the textbox strings and then display the messagebox??
View 11 RepliesI want to know how I can check the string 'enabled' in my php page for each paragraph while being matching with each listview items that i have extract the strings from my php page?
Here's for an example: i check the string 'enabled' in paragraph one and if it does have it then tick the checkbox on the listview item 1 otherwise untick.
i check the string 'enabled' in paragraph two and if it does have it then tick the checkbox on the listview item 2 otherwise untick.
i check the string 'enabled' in paragraph three and if it does have it then tick the checkbox on the listview item 3 otherwise untick.[code]...
I am trying to make a regex that will match strings between a comma only if the comma is outside of complete brackets. Brackets inside of " " should not count. Examples below. [code]
View 6 RepliesIs it possible to use regex with Range.Find.Text or set the Word.Range according to a regex in word automation? I just want to find strings that match a regular expression an manipulate them.
View 2 RepliesI have users check off lab facilities in a UI. I want to use linq to fetch corresponding records for all of the labs that they have checked off. Basically,
Dim myRecs = (From l As EpiData In myDataContext.EPIDatas Where l.facility= _
one of the checked labs
So basically, I need to write a linq query where the "strings" to match are determined at runtime. Is there any way to do this easily? I know that there is a library out there called dynamic LINQ, but (1) it's in C# and I'm writing in VB (2) I'm really just looking for a single, simple solution for this single case.
Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 RepliesAm trying to match characters or combination of the characters i specify in any order they appears
vb
Regex.IsMatch(teststring "[nuls]")
what i want matched is either any single character, or combination of any of them in any oder. this means that it should not match any character not specified in the pattern.
For example
it should match
n,u,l,s,nu,un,lun, sl etc
not
ny, nx so etc or any other
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 RepliesI have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
I'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
I have been looking for examples to find the string between two strings. This top one works fine;
Public Sub ReadData(ByRef keywordStart As String, ByRef keywordEnd As String, ByVal filename As String)
Using reader = New StreamReader(filename)
[Code].....
Now the first one is fine - Ext_Volume is result of the string between the strings <Volume> and </Volume>. <Volume> and </Volume> are unique so this is straight forward.
However the second one - "^FDExp:" is unique, but "^FS" is not unique. There are occurances of "^FS" before and after "^FDExp:".
How do I get the string to search AFTER the occurrence, not before etc?
Dim str As String
Dim str2 As Array
str = "blabla duhduh"
str2 = str.Split(" ")
Say the string is something like
bla bla bla bla (cat) bladfdskdfd dsgdsdksf (dog)
dfdshfdskdskfsdfkhsdf sdkfhdsfkdf (kathy) fdsfhdskfhdsfkd (doggy)
I want a generic.list (of string) containing
cat
dog
kathy
doggy
How to do that with regular expression in vb.net
Later I want to do something more complicated like getting all strings between "url":" and ", from this strings
[Code].....
Is there an easy way to find a certain string within a string and then return the strings that you find as an array?I have written this:
Public Function FindStrings(ByVal strSourceString As String, ByVal strStartString As String, ByVal strEndString As String) As String()
Dim StringStartposition As Integer
Dim StringEndPosition As Integer
Dim Currentposition As Integer = 1
[Code]...
I have this string called time. It's value is in this format: HH:MM:SS The numbers change, but the format stays the same. I want to separtate the code into 3 strings Hour, Minutes, Seconds.
View 2 RepliesI have a DataGridView that has some columns with dates. It binds to an in-memory Datatable which gets loaded from an string array of data passed back from the backend Some of the rows returned have nulls for the date columns. Solution 1: If I define the Date column in the DataTable as "string" I can easily convert those nulls to empty strings and display it in the grid as empty strings (desired results). However, if the user clicks on the date column header to sort by date, it doesn't order the rows as you want. You get a purely string sort order. Not acceptable
[Code]...
I am trying to create the below matrix in my vb.net so during processing I can get the match scores for the alphabets, for example: What is the match for A and N?, I will look into my inbuilt matrix and return -2 Similarly, What is the match for P and L?, I will look into my inbuilt matrix and return -3 how to go about it, I was trying to use nested dictionary like this:
Dim myNestedDictionary As New Dictionary(Of String, Dictionary(Of String, Integer))()
Dim lTempDict As New Dictionary(Of String, Integer)
lTempDict.Add("A", 4)
myNestedDictionary.Add("A", lTempDict)
The other way could be is to read the Matrix from a text based file and then fill the two dimensional array.
I have the following code
TestArray(0) = "<RD><PS:CL><JL:Jump,""(.*?)"">"
TestArray(1) = "<RD><PS:CL><JL:Jump,""(.*?)"">(B)(.*)"
TestArray(2) = "<RD><PS:CL><JL:Jump,""(.*?)"">(C)(.*)"
Do Until xRead.EndOfStream
'do stuff here here with test array(i)
'do stuff here here with test array(i)
'do stuff here here with test array(i)
'do stuff here here with test array(i)
i = i+1
loop
I would like it so that instead of "Do Until xRead.EndOfStream" I would like to read the file line by line until a match is found, then add +1 to i and repeat.
I have :
[Code]...
I think I have explained my problem properly..
I have a RegEx I am using in vb.net and i can get all the matches of the text but i want to get the first match of the text, this is what i am using.
[Code]...
I'm using the following VB.net Code to find phone numbers in HTML and make them "clickable":
Regex.Replace(pDisp.Document.Body.innerHTML, "([0-9+ ]{3,6}[s]{1,1}[0123456789 -/]{4,15})", "<a href=http://DIAL/$1>$1</a>")
There appears an issue if the numbers contain white spaces, for example:
089 12233 455
This will be replaced with:
<a href=http://DIAL/089 12233 455>089 12233 455</a>
Is there a way to get
<a href=http://DIAL/08912233455>089 12233 455</a>
instead?
I have a mvc 3 app that uses EF. In one function I need to get a count of rows that match a statement. I thought I could just do it like this:
Dim _ClassCount As Integer = _CurrRegistrants.Where(Function(c) c.tues_class = _CurrCourse.course_ref).Count
But that stays at 0 even when there are 40 records that match the criteria.. I think I have the right idea I just need to change the syntax a little..
Dim _CurrRegistrants As List(Of reg_classes) = db.reg_classes.ToList
For Each Course In _courses.Where(Function(a) a.course_day = "Tuesday")
Dim _CurrCourse As cours = Course
[Code]....
The quick brown fox jumps over the lazy dog" is an English-language pangram, alphabet! that is, a phrase that contains all of the letters of the alphabet. It has been used to test typewriters alphabet. and computer keyboards, and in other applications involving all of the letters in the English alphabet.I need to get the "alphabet." word in regex. In the above text there are 3 instances. It should not include "alphabet!". I just tried regex with
MatchCollection match = Regex.Matches(entireText, "alphabet.");
but this returns 4 instances including "alphabet!". How to omit this and get only "alphabet."
if i have 12 textboxes and i want to make sure none of them contain matching text (and no i don't trust the user to do this :P ) how would i go about this?
View 3 RepliesI have a textbox and a rich textbox, all I want to do is if the field in textbox1 matches any field in richtextbox1 then display a label.
Normally I would try
If Textbox1.text = Richtextbox1.text then
label1.text "Field match"
however this wont work as there are many fields in richtextbox1?
im making a tile slide game and im stuck . im trying to find out if the images are in the right place. how would i check to see if the images are in there respective picture-boxes?
View 3 Repliesvalidating a 9-digit number.
CANNOT BE -----------
000000000
111111111
[code]....
I had just managed to get the first piece done -- "^(??!0+|1+|2+|3+|4+))d{9}$"