How can I count the number of special characters/ numbers that is inputted in a textbox.
For example:
079348625!@#$%^&*
Number Count: 9
Special Characters: 8
Thanks !
Counting some characters .
Page 1 of 16 Replies - 409 Views - Last Post: 09 March 2012 - 02:38 PM
Replies To: Counting some characters .
#3
Re: Counting some characters .
Posted 07 March 2012 - 06:12 AM
To follow up on nK0de's excellent suggestion, have a look at this link on using regular expressions in vb6.
They may look a little awkward to begin with, but they are very powerful and worth taking the time to learn a little about them.
They may look a little awkward to begin with, but they are very powerful and worth taking the time to learn a little about them.
#4
Re: Counting some characters .
Posted 07 March 2012 - 06:24 AM
:facepalm: oh shit! I opened this thread through the email notification and I didn't notice it was a VB6 question! I thought its VB.NET! sorry, my bad. and thanks maj3091 for the article on using RegEx in VB6. Haven't done that and didn't even know its possible in VB6.
#5
Re: Counting some characters .
Posted 08 March 2012 - 04:01 PM
maj, it's not exactly the case that regular expressions aren't available except through a 3rd party solution, as the article you link suggests. Just set a (don't have VB6 here, can't quite remember name) reference to the VBScript regular expressions library.
#6
Re: Counting some characters .
Posted 09 March 2012 - 01:01 AM
BobRodes, on 08 March 2012 - 11:01 PM, said:
maj, it's not exactly the case that regular expressions aren't available except through a 3rd party solution, as the article you link suggests. Just set a (don't have VB6 here, can't quite remember name) reference to the VBScript regular expressions library.
To be honest Bob, I didn't realise the article said that, as I just quickly scouted through whilst on lunch at work, and it looked a good intro to RegEx functionality. I just assumed it referenced the inbuilt functionality.
Apologies if that caused any confusion OP.
This post has been edited by maj3091: 09 March 2012 - 01:01 AM
#7
Re: Counting some characters .
Posted 09 March 2012 - 02:38 PM
Kinda figured.
they snuck that in at the end. And I would say that it is certainly a good intro to regex functionality.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|