Brent Arias
Brent Arias

Reputation: 30165

Wrongly Making an Empty Match

I've got this data:

73636333759.90
73637286413.70
73637286413.70

I want to transform it to this:

'73636333759.90',
'73637286413.70',
'73637286413.70',

However, my regex is instead producing this:

'73636333759.90','',
'73637286413.70','',
'73637286413.70','',

I get the same result, whether using Visual Studio's search and replace or Rad software's regex designer. My regex for VS is:

match: {[0-9\.]*}  
replace string: '\1',

Using regex designer I tried:

match: (?<accountMask>[0-9.]*)  
replace string: '${accountMask}',

What am I doing wrong?

Upvotes: 0

Views: 71

Answers (1)

nachito
nachito

Reputation: 7035

Try using + rather than *, * matches 0 or more, whereas + matches 1 or more. More information here

Upvotes: 3

Related Questions