It sounds pretty simple but I cant figure this out, please help me out.
So… I have file with following data:
Name: Santi
Surname: Dore
Name: Rob
Surname: Doe
and so on..
I need to match only the whole part that starts with “Name:” … NOT “Surname:” …
Here is what I am using right now to match it:
/Name(:)(.*)/i
It will match both but I need just Name: …
Please dont suggest any other way of finding, just please help me out with regex to work the way I described.
Leave off the
imodifier, which makes the regex case-insensitive.And/or, add some word boundaries: