---
schema_version: "1"
id: 615093f1604101c57152c00324979d35e9a9f5bf018ef85d6d7ea26d71bbbe3e
title: Transformations & Regular Expressions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/rt_adv_config_data_feeds_maps_regx.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.rt_adv_config_data_feeds_maps_regx.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 52c18bb92ea8b999c14fc7ad112e8d9739c3f4a5487607ce627b3a2b3943dfe1
description: Point of Sale data mapping uses transformations and regular expressions so you can get values in the correct formats. Use transformations such as applying arithmetic operations, formatting text, and converting date and time values. Regular expressions use patterns to find and replace strings to refine your data mapping.
products:
  - Commerce
release: "264"
---
# Transformations & Regular Expressions

Point of Sale data mapping uses transformations and regular expressions so you can get values in the correct formats. Use transformations such as applying arithmetic operations, formatting text, and converting date and time values. Regular expressions use patterns to find and replace strings to refine your data mapping.

## Populate Target Field with Constant Value

If you want a target field to always have some constant value, map a required field (e.g., id) to the target field with a regex replace all.

Regex Replace All

- Regex: ^.\*$
- Replace: \[CONSTANT\_VALUE\]
- Group Index: \[empty\]

## Strip Currency Code from Price

Input price:

- 59.50 USD

Replace All

- Find: USD
- Replace: \[empty\]

Output price:

- 59.50

## Transform Date into Milliseconds

Input date:

- 2019-12-21 10:00:00-05:00

Date to Epoch

- Transformation Type: Date to Epoch
- Date Format: yyyy-MM-dd HH:mm:ssX
- Epoch Type: Milliseconds

Output date:

- 1576940400000

## Transform Store Hours

Input values for store hours:

- Sunday 11AM TO 7PM
- Monday 10AM TO 9:30PM
- Tuesday 9:30AM TO 9:30PM
- Wednesday 10:30AM TO 9PM

Composite (Multiple Operations):

- Regex Replace All
    - Regex: (Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday) (\[\\d\]{1,2})(AM|PM) TO (\[\\d\]{1,2})(AM|PM)
    - Replace: $1:$2:00:$3:$4:00:$5,
    - Group Index: \[empty\]
- Regex Replace All
    - Regex: (Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday) (\[\\d\]{1,2})(AM|PM) TO (\[\\d\]{1,2}:\[\\d\]{2})(AM|PM)
    - Replace: $1:$2:00:$3:$4:$5,
    - Group Index: \[empty\]
- Regex Replace All
    - Regex: (Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday) (\[\\d\]{1,2}:\[\\d\]{2})(AM|PM) TO (\[\\d\]{1,2}:\[\\d\]{2})(AM|PM)
    - Replace: $1:$2:$3:$4:$5,
    - Group Index: \[empty\]
- Regex Replace All
    
    - Regex: (Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday) (\[\\d\]{1,2}:\[\\d\]{2})(AM|PM) TO (\[\\d\]{1,2})(AM|PM)
    - Replace: $1:$2:$3:$4:00:$5,
    - Group Index: \[empty\]
- Replace All
    
    - Find: Sunday
    - Replace: 1
- Replace All
    
    - Find: Monday
    - Replace: 2
- Replace All
    
    - Find: Tuesday
    - Replace: 3
- Replace All
    - Find: Wednesday
    - Replace: 4
- Replace All
    - Find: Thursday
    - Replace: 5
- Replace All
    - Find: Friday
    - Replace: 6
- Replace All
    - Find: Saturday
    - Replace: 7

Output values for store hours:

- 1:11:00:AM:7:00:PM,
- 2:10:00:AM:9:30:PM,
- 3:9:30:AM:9:30:PM,
- 4:10:30:AM:9:00:PM,

## Resources

- [https://regex101.com/](https://regex101.com/)
- [https://www.freeformatter.com/java-regex-tester.html](https://www.freeformatter.com/java-regex-tester.html)