I have a 2 textbox
1 text box is empty .
text2 is multine true
second text box have some words.
text2 text Example :
"12345 is my number and 03451234567ddddsfsa
somethingis wrong034512345find 03451234567"
..............
i want to find 03451234567 11digit number in text box with first 3 or 4 numbers
i mean when we type 034 or 0345 in text1 and click command button then find 0345 in text box and select all numeric number means 03451234567 and add to a listbox.
Note: when find 0345 and check 11 digits or max . if find max to 11 digits so do not add
in listbox.

i hope every one can understand what we want to do .
simply i want to find 11 digit mobile numbers in text box with first 3 or 4 words.

This can be done easily with regular expressions. The pattern

"\d{11}"

Matches any 11 digit sequence. The trick, in your case, is to replace the numeric parameter with the number of digits remaining. If you are looking for an 11 digit number beginning with 034 then you create the pattern

"034\d{8}"    

I can't try this for you under VB6 (I don't have it installed), however, here is a link to a Microsoft article on how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.