How To Find A Pattern
Nov 9, 2009i got this var: dim myvar as string
[Code]....
(Someone know how insert this ==>"<== into a var ? In PHP i use " ex: myvar = "Console.Writeline("hii")" but didnt work in vb net, how do it ?)
i got this var: dim myvar as string
[Code]....
(Someone know how insert this ==>"<== into a var ? In PHP i use " ex: myvar = "Console.Writeline("hii")" but didnt work in vb net, how do it ?)
How do i find a pattern in richtextbox?[code]...
View 2 RepliesI need your help to find the right pattern to extract a string that i need.. The problem is that i have to extract all there is between this caracters:<a href="/url?q=(text to extract whatever it is)& I tried this pattern, but it's not working for me! : /(?<=url\?q=).*?(?=&)/
i'm programming in Vb.net, this is the code, but i think that the problem is that the pattern is wrong:
Dim matches As MatchCollection
matches = regex.Matches(TextBox1.Text)
For Each Match As Match In matches
listbox1.items.add(Match.Value)
Next
I've been searching on Google for a recurrence pattern class for awhile now. I need a class I can use to schedule daily, weekly, monthly, and yearly recurrences of messages. I've found references to appropriate classes but no available downloads.
View 1 RepliesI am working on my application to extract the value from my php page using with the regex pattern. I can extract the value using with the mystrings1 tags with no problem, but I can't be able to extract mystrings1 and mystrings2 tags in the same line.
[Code]...
I need to find illegal characters in a windows forms textbox
The textbox text is sent as an sms text message and illegal characters are not allowed
e.g 1 client pasted some text from a word document into the texbox and the ' in msword appears as slanting ' in the textbox (see below)
e.g msword text - This is a new test of the Services
after pasting in textbox - This is a new test of the Services
The sms company have advised the slanting apostrophe is a unicode character
How can I find characters like above so I can remove them before sending the sms text
Has anyone ever used VB to analyze data to find patterns? I would like to analyze several hundred sequential data points to look for a fairly uniform "up-down" pattern, very similar to a square wave.
View 3 Replieshave a 1mb file, should get the pattern from it
pattern should be like this
6numbers + 10&FF + 6numbers
in the hex binary editor it looks like this
[code].....
I'm looking to use a RegularExpress to find a specific pattern for character within a sentence.I'm look to find a any Word that start with '_', that contain only upper case character with number and with like
'_ABCF'
'_EEE1'
But not
'ABC_DE'
until now I've found "^_([A-Z]|[0-9])*", but this pattern do not seam to work within a complete sentence.
Private someSub()
If someBoolean = True Then Exit Sub
' do some great work because someBoolean is False
End Sub
I know there is a name for this. The idea is to check something and if it isn't what you want then you stop code processing. I thought it was called "escape pattern", but Google isn't confirming that name.
when should a trigger in your head go off signifying "Aha! I should use the factory pattern here!"? I find these moments will occur with many other design patterns, but never do I stop myself and think about this pattern.
View 6 RepliesHow to use MVC Pattern efficient?
View 8 RepliesHow would I remove an alpha-numeric sub string in a string that meets these rules:
J111DD
L###LL
l = Leter
# = Number
I am using the Entity Framework with POCO's generated using the T4 Templates. I have the generated classes in a separate assembly. Ok, so a very simple example: I have a Category entity in the model which has SubCategories (1-Many with SubCategory). When I use the following code, I get The ObjectContext instance has been disposed and can no longer be used for operations that require a connection. [Code]
View 2 RepliesI am normally a c# programmer but am now working in VB for this one project when I use to set up a singleton class I would follow the Jon Skeet model
public sealed class Singleton
{
static Singleton instance = null;
static readonly object padlock = new object();
[code]....
I get StackTracker.Instance.Instance and it keeps going, while it is not the end of the world it looks bad.is there a way in VB to hide the second instance so the user can not recursively call Instance?
When are predicates appropriate and what is the best pattern for usage? What are the advantages of predicates? It seems to me like most cases where a predicate can be employed a tight loop would accomplish the same functionality?
View 3 RepliesI have data like this in text file
202103
20204
20210
202110
I want to change the above data to be like this
(2 2.50 03.0)
(2 2.00 04.0)
[Code]...
I have text like following example
XXZZXXXZXXZXXXXZZZZZZXVVVVVXZVZ
and also I have two patterns like XX and ZZ I want to find longest possible string which include above given two patterns and return starting and finishing index of the array.
I want my app to look for a byte pattern in a process and return the first memory address of that byte pattern. I know I should use ReadProcessMemory and a loop, but I don't really know how to create a function for that,
View 2 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}$"
I have a contextStrategie :
Shared Sub New()
If ConfigurationManager.AppSettings.GetValues("Context").ToString = "Custom" Then
_context = New CustomHandler
[code]....
I'm trying (for test purpose) to obtain the name of the class used for my instance :
Dim context As ContextStrategie = New ContextStrategie()
'what I tried :
test.InnerText = context.GetType.Name
What I tried return ContextStrategie, which is useless to me.obtain either CustomHandler or XMLHandler?
ok what i'm trying to do is make a pattern generator. i will have to do some substuutting too.ex:i wand to make A=1,B=2,C=3 ect.......the pattern is 3,3,2,3,3,3,2and say i make a button called "E" when i click that i want the patter from e since E=5 in the textbox it shoud come up "E,F,G,H,I,J,K,L" up to 8 thats all i want is it possible
View 17 RepliesI am working on creating a customized UI composite control. This control would be a container to several other custom controls.As a first step, i am creating the container UI using a singleton pattern. This is because at any point in time only one isntance of this container is allowed to be created. This is fine.Now i want to practice interface based desgin. So i introduced a sinple interface calleD IdesignSurface which has two properties. I would like my singleton class to implement this interface,so i tried something like this and got an error saying "end of line
NotInheritable
Class DesignSurface
implements IDesignSurface
[code]......
Im trying to Implement the Singleton Pattern and im wondering if this is "Thread Safe" or if I am going to have to explicitly perform a SyncLock on the object instance? Example:
Public NotInheritable Class SingleTon
Private Shared _singleton As SingleTon
Private Sub New()
[Code].....
I tried it both ways, using the SyncLock and without, just not sure which one to be using?
Using VB.Net, I'm looking for best practices in dealing with the following idiom:[code]What I really want is something VB.Net doesn't offer -- additional and simultaneous iterators on For Each statements.[code]I'm interested in both Linq and non-Linq recommendations, comments about Copy method design, comparisions to C# or other languages.
View 3 RepliesIt is for vb.net 2008 with access database.At the moment it matches based on paramValue, and needs an exact match.How can I change it to look for a pattern instead?? For example I want anything that contains the text "Fizz" and then "Bom".[code]...
View 2 RepliesWhat would you recommend as the "best" VB.NET and C# books for learning Design Patterns?eferably books that actually give examples of when to use the patterns. I need torecommend some books to a group of C# and VB.NET developers.
View 19 RepliesI was considering validating some input using RegEx to match a pattern of
Firstname, Lastname
I largely have it, but there is so much variability in names that I'm not quite sure if any pattern is safe. In fact, in this case, I know that no pattern is safe, so I have built in a means for the user to accept whatever was entered, regardless of what it was, which isn't so great.
What I'm wondering is whether or not there is a safe Regex pattern that will cover names in this format, or will cover at least most of them. What I currently have is:
"^[A-Z][a-z]+, [A-Z][a-z]+"
But that will allow through things like Hiker, Shaggy, the, which is fairly silly, but shouldn't be allowed....I think. Does anybody use names with commas in them? I know that apostrophes are fairly common, though I'm pretty sure I can ignore them.
Need a pattern to match a string which should NOT be --
777777777
888888888
999999999
Or start with 00 or 02 or 04. when i tried to go create a pattern to match the above requirements, i got it done by - Dim _pattern6 As String = "^(7+|8+|9+|(00|07|08|09|17|18|19|28|29|43|48|69|70|78|79|80|96|97).*)$". could not get the NOT MATCH part done.
I use resharper 6.1.I use VB.Net and I want to search for this. for all the help.ShowHelp things and put those in a wrapper.So I have something like this.
Private Sub BtnHelpClick(sender As System.Object, e As EventArgs) Handles btnHelp.Click
Help.ShowHelp(Me, HelpFiles.AuditTables, HelpNavigator.TopicId, AudittablesContext.AuditTables)
[code]....