0

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.

2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by Reverend Jim
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.