0

Conditional Regex - Add a space?

There might be an obvious answer that I'm missing, but I've got a minor issue and I'm hoping there's a simple way through it.

We have a DataSet in which the tag names either just say what they are, or if there are multiple of those things, will have a number next to them. For instance, if Area 1 has a single sales meter, the tag will be

Area 1.SALES.Flow

But if Area 2 has two sales meters, it will be

Area 2.SALES01.Flow
Area 2.SALES02.Flow

I want to create a new view in which SALES is renamed to Sales Meter and there is a space between meter and the number if it exists. So the result will be

Area 1.Sales Meter.Flow
Area 2.Sales Meter 01.Flow
Area 2.Sales Meter 02.Flow

Is this possible. I'm able to replace the SALES with Sales Meter. But how do I conditionally add a space if there is a number. The only thing I can think of is 2 rules. The first one replaces SALES with Sales Meter, the 2nd replaces Sales Meter\d\d with Sales Meter \d\d. Any other ideas?

Reply

null

Content aside

print this pagePrint this page
  • 12 hrs agoLast active
  • 3Views
  • 1 Following