15,890,438 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by amit_upadhyay (Top 41 by date)
amit_upadhyay
9-Jan-13 5:44am
View
learn how to code before finding faults. the globalvariable is a class
amit_upadhyay
1-Dec-11 3:32am
View
hey thanks but i did get the ascii of the chars (substring till a char or digit is found) but it returned 32 which i suppose is space. Will getting it in bytes help me anyway ?
amit_upadhyay
28-Nov-11 5:14am
View
yeah even that would work. How do i do that? Could you point me to some link or code plz? I mean after a thread has completed its work do i just take another url from list?
amit_upadhyay
13-Nov-11 23:33pm
View
hey thanks. it works great. But iam stuck with implementing this into my main program which is a slightly modified :
Dim fil2 As New StreamReader("new2.txt")
Dim i As Integer = 0
Dim start2 As Integer = 0
Dim rgx As Regex
Dim rpl As String = RichTextBox1.Text
Do While fil2.Peek > -1
Dim StringToCheck As String = fil2.ReadLine()
Dim prev As String = StringToCheck.Split("|")(0).Trim()
If (StringToCheck.Split("|")(0).Split(" ").Count >= 2) Then
Try
rgx = New Regex("(?!{[^{]*)" & prev & "(?![^{}]*})", RegexOptions.IgnoreCase)
Dim z As Integer = 0
rpl = rgx.Replace(rpl, "zzzzxxxxzzzz")
Catch ex As Exception
End Try
End If
Loop
fil2.Close()
RichTextBox1.Text = rpl
currently do you see anything which can be wrong with this code? What it is doing is reading a text file, splitting the line at "|" and then count the number of words in first segment. Then it will create a pattern dynamically including the split word instead of "buy". The output is not what i want.
with the above string i get :
zxzxzxzxzxzxzxzxzx zxzxzxzxzxzxzxzxzx zxzxzxzxzxzxzxzxzx to zxzxzxzxzxzxzxzxzx buy zxzxzxzxzxzxzxzxz zxzxzxzxzxzxzxzxzx xzxzxzxzxzxzxzxzx xzxzxzxzxzxzxzxzx ho zxzxzxzxzxzxzxzxzx zxzxzxzxzxzxzxzxzx zxzxzxzxzxzxzxzxzx d zxzxzxzxzxzxzxzxzx this zxzxzxzxzxzxzxzxzx house zxzxzxzxzxzxzxzxzx is zxzxzxzxzxzxzxzxz zxzxzxzxzxzxzxzxzx xzxzxzxzxzxzxzxz zxzxzxzxzxzxzxzxzx xzxzxzxzxzxzxzxzx good zxzxzxzxzxzxzxzxzx that zxzxzxzxzxzxzxzxzx i zxzxzxzxzxzxzxzxzx will zxzxzxzxzxzxzxzxzx {buy|purchase|rent|acquire} zxzxzxzxzxzxzxzxzx this zxzxzxzxzxzxzxzxzx place
amit_upadhyay
13-Nov-11 23:22pm
View
Deleted
hey is there any difference if the word buy is changed to be a 2-3 word string. The above works flawlessly but this :
Dim rgx As New Regex("(?!{[^{]*)wanted to(?![^{}]*})")
RichTextBox1.Text = "I wanted to purchase a house and this house is so good that i will {wanted to|purchase|rent|acquire} this place"
RichTextBox1.Text = rgx.Replace(RichTextBox1.Text, "purchase")
gives the following output :
I purchase purchase a house and this house is so good that i will {wanted to|purchase|rent|acquire} this place
amit_upadhyay
13-Nov-11 22:47pm
View
yup exactly.
amit_upadhyay
13-Nov-11 3:20am
View
ok thanks. i will try regex and string to see how it goes.
amit_upadhyay
13-Nov-11 3:06am
View
nope. should i try that? Will it really make any difference ? Are gui components generally slow?
amit_upadhyay
3-Nov-11 22:34pm
View
damn. I asked on atleast 3 other forums with actual question of whether we can pass parameter to a function via thread and all i got was plain no. Thanks for the help and link. Much appreciated. Got it working :)
amit_upadhyay
20-Apr-11 6:39am
View
Deleted
sorry not working - i tried this :
If (RichTextBox4.Text <> "") Then
Dim m As Match
If (Regex.IsMatch(RichTextBox4.Rtf, "(?<=\\\\\\\\ul).*(?=\\\\\\\\ulnone)")) Then
MsgBox("yes")
End If
End If
I get nothing..
amit_upadhyay
20-Apr-11 6:37am
View
Deleted
why does this code give me indexoutofbounds exception?
If (RichTextBox4.Text <> "") Then
Dim m As Match
m = rgx2.Match(RichTextBox4.Rtf)
If (Not m Is Nothing) Then
MsgBox(m.Value(0))
End If
End If
amit_upadhyay
28-Nov-10 1:01am
View
I will go through the code. But a little doubt : "An array of items containing the differences is returned." - This returns words from both the strings or only one string (former or later)? Or both is important to calculate the difference?
amit_upadhyay
29-Sep-10 8:23am
View
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
amit_upadhyay
29-Sep-10 8:22am
View
your code works fine. I didnt get what was wrong with my code? Anyways maybe your rewritten code has some advantages over mine. Thanks..
amit_upadhyay
3-Sep-10 21:57pm
View
Reason for my vote of 1
if you cant help then dont
amit_upadhyay
3-Sep-10 21:56pm
View
Reason for my vote of 5
perfect answer
amit_upadhyay
3-Sep-10 21:54pm
View
wow!! works like a charm. Thanks.
Note : To randomize the changed strings i included this in replacematch :
Dim parts = m.Groups.Item(1).Value.Split(New Char() {"|"c})
Return parts(r.Next(0, parts.Length))
and this at top :
Private r As New Random()
amit_upadhyay
3-Sep-10 21:40pm
View
no, i saw this in a software and tried to implement it
amit_upadhyay
24-Aug-10 7:13am
View
yes but how do i select the word??
amit_upadhyay
14-Aug-10 11:05am
View
i ignored html while posting because it damages the xml part. this way no one will understand a valid rss xml feed.
amit_upadhyay
1-Aug-10 22:55pm
View
Reason for my vote of 5
works perfectly
amit_upadhyay
31-Jul-10 10:09am
View
thanks but why does it get weird when i use a string like : "hello i want to {help|meet|call} you {please|come|soon}." i get message as : "hello i want to call} you {please". i guess iam missing something??
amit_upadhyay
30-Jul-10 13:24pm
View
Reason for my vote of 5
very helpful
amit_upadhyay
30-Jul-10 13:24pm
View
my apologies for rude behaviour. thanks for your help. (i tried searching by the topic of this question)
amit_upadhyay
30-Jul-10 13:15pm
View
Deleted
did you even read what i wanted?? what you are giving me is an integer, what i need is a point. a location consists of two integers.
amit_upadhyay
29-Jul-10 21:56pm
View
we can create an array of strings as an argument right??
amit_upadhyay
29-Jul-10 21:56pm
View
i thought about using dictionary, but then a dictionary will allow only as many synonyms as specified in the arguments list. But you see some words might have 2 synonyms, some 3 meanings, so what to do?
amit_upadhyay
29-Jul-10 11:32am
View
hahahaha ok got it. how stupid of me.
amit_upadhyay
28-Jul-10 12:17pm
View
i got the selectedtext change part. but how do i change the text when spinning? after the user has selected evrything he wants to change, he will click on spin, then the whole article will come into new richtextbox, but only one word should come from the spin syntax. how do i do this? i think i will need to check for braces in the whole article, and then if it contains "|" then maybe replace text?
amit_upadhyay
28-Jul-10 11:47am
View
its a windows application not a web application, that is why i need to do it in a richtextbox
amit_upadhyay
22-Jul-10 10:11am
View
hey Dalek indeed you helped me learn something.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Shell("notepad", vbNormalFocus)
Clipboard.SetText("my first trick")
SendKeys.Send("^v")
End Sub
works perfectly...
i will try with html forms later.
amit_upadhyay
22-Jul-10 9:56am
View
thanks for your motivation. will try my best.
amit_upadhyay
21-Jul-10 12:37pm
View
Deleted
amit_upadhyay
21-Jul-10 12:37pm
View
the form is not mine. It is on another website (not under my control). So how do i proceed?
amit_upadhyay
20-Jul-10 3:23am
View
got it in vb.net (directcast), but this is not working. I have been able to automatically fill two other blog sites : blog.com and blog.co.in (without mshtml) but blogger doesn't seem to work.
amit_upadhyay
20-Jul-10 3:13am
View
thanks but since iam using vb.net could you tell me, what will be the second line in vb.net ?
amit_upadhyay
19-Jul-10 9:16am
View
sorry, first time i posted incomplete question.
amit_upadhyay
18-Jul-10 12:46pm
View
thanks works perfectly
amit_upadhyay
18-Jul-10 12:27pm
View
can you modify it a little to get this :
suppose i know "http://devvicky.com" from "http:/my.devvicky.com" (i dont know "my."), then how can i get the unknown part, i suppose you remove first string from second but how?
amit_upadhyay
18-Jul-10 12:19pm
View
i can get all the links but how to find the ones starting with a particular pattern?? it is more of a string problem. Find a substring starting with given pattern
amit_upadhyay
22-Jun-10 10:39am
View
suppose there are many
tags and i want the one between div id="body then????
could u post a code snippet???
Show More