Need regex pattern to find the flowing:
Social security Number
phone number
→ I have used “(?<=social security number )(-| |\d)+” However, it is finding all the number patterns.
Need regex pattern to find only in SSN pattern(with and without -) and phone number (with and without country code).
1 Like
@Arun_Singh
give us a sample
Hi @Arun_Singh ,
Could you maybe provide us with Sample data for us to understand the pattern and the expression that we could use ?
Hello @Arun_Singh , Kindly share the spme sample inputs.
Try this
(?<=social security number*?)[\d\W]+
Gokul001
(Gokul Balaji)
May 8, 2023, 8:22am
5
Hi @Arun_Singh
Can you share the sample input?
How about this regex expression?
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=Social security Number)-\d+|\s\d+").Tostring
Regards
Gokul
Thanks for the replies, However I don’t have any samples as I’m trying to integrate with ChatGPT using input dialog box, when user ask the questions in input dialog box and BOT will validate the question- if SSN or Phone number pattern is available in the question, the BOT should say don’t share your SSN or phone number to ChatGPT before it passes the HTTP request.
Arun_Singh:
Need regex pattern to find the flowing:
Social security Number
phone number
→ I have used “(?<=social security number )(-| |\d)+” However, it is finding all the number patterns.
Need regex pattern to find only in SSN pattern(with and without -) and phone number (with and without country code).
To find only Social Security Numbers and phone numbers, you can use the following regex patterns:
Social Security Number (SSN) pattern:
With dashes: \b\d{3}-\d{2}-\d{4}\b
Without dashes: \b\d{9}\b
Phone number pattern (with and without country code):
With country code (e.g., +1): (?<!\d)\+\d{1,3}-\d{3}-\d{3}-\d{4}\b
Without country code: \b\d{3}-\d{3}-\d{4}\b
Make sure to use the appropriate pattern depending on the type of information you are searching for.
Rc_Cruz
(Rc Cruz)
March 4, 2024, 4:58pm
8
So how would I get this person ssn Destiny Gaspar