mzurita
mzurita

Reputation: 690

Regular Expression (VB.NET)

How I can convert this:

, ...Name: John, LastName: Smith, Gender: Male, ...

into

, ...Name: John, Gender: Male, ...

Notice I replace " LastName: XXXXX," by "" (empty chain)

I've tried with

'Remove LastName...
pattern = " LastName.*,"
replacement = ","
msAccessQuery = Regex.Replace(string, pattern, replacement)

Thanks in advance.

Upvotes: 0

Views: 39

Answers (1)

Sabuj Hassan
Sabuj Hassan

Reputation: 39355

pattern will be:

 \s*LastName:[^,]*,

Upvotes: 1

Related Questions