Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

how I can build a Regex that will bring me as first Group

Mustermann
filiale01

and second Group

"M" from Max after Comma.

This are my fields:
Mustermann, Max

filiale01


My result should be:
MustermannM 

filiale01


My goal ist to build this strings together with $1$2

What I have tried:

I have tried this, but with this regex I didnt get the filiale01 as Group1.

([A-Za-z0-9äöüÄÖÜ]{1,}),{1}\s([A-Za-z0-9äöüÄÖÜ]{1})
Posted
Updated 29-Sep-21 1:09am

1 solution

Try this:
C#
(\w+(?:,\s+)\w{1})(?:.*?^^)(.*)
You will probably need MultiLine and SingleLine Regex options set.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900