I need to add a dash to a string, if there any characters after those digits, how would I do this with regex?
Examples:
dpa3455ad = dpa3455-ad
4545fd = 4545-fd
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use this regex: ( asssuming you want to add a dash at the first point of occurence of a non-digit after a set of digits)
and replace with
$1-$2C# code:
Will give –
dpa3455-adTo keep it simple and insert a
-at every occurence of a a non-digit following a digit, use this:Will give –
dpa3455-ad1-s