|
-
May 20th, 2004, 05:37 PM
#1
Thread Starter
Lively Member
Regex and a Social Security #
I read up on Regular Expressions, can it handle reading through a string and get a social security # after it sees "SSN:"
So for example, an SSN would look like:
SSN: 5 5 5 - 5 5 - 5 5 5 5
I would like to grab all the underlined numbers and display them like this after I see SSN:
555-55-5555
Any ideas?
Chris
-
May 20th, 2004, 06:01 PM
#2
Member
Hello Trancedified,
Try this :
Code:
If Not Regex.IsMatch(TextBox.Text, "^\s*(\d{3}-\d{2}-\d{4})\s*$") Then
TextBox.ForeColor = Color.Red
Else
TextBox.ForeColor = Color.Black
End If
Hope this helps
-
May 24th, 2004, 12:26 PM
#3
Thread Starter
Lively Member
Wow cool! Would you happen to know how to do a screen scrape of a desktop application?
(I need a way to extract the social security number, this app doesn't have the copy/paste capabilities, it's very OLD)
Our client has this application open and doesn't want to write down the SSN on a piece of paper and have to re-enter it in another application.
Thanks!
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|