# Stripping Financial Values from Strings in and Arc Map

**URL:** <https://community.cdata.com/t/stripping-financial-values-from-strings-in-and-arc-map/154>\
**Category:** CData Arc\
**Tags:** question, arc\
**Created:** [April 19, 2023, 7:41pm UTC](https://community.cdata.com/t/stripping-financial-values-from-strings-in-and-arc-map/154 "2023-04-19T19:41:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wnielson](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@wnielson](https://community.cdata.com/u/wnielson)\
**Post date:** [April 19, 2023, 7:41pm UTC](https://community.cdata.com/t/stripping-financial-values-from-strings-in-and-arc-map/154/1 "2023-04-19T19:41:23Z")

</div>

I need to be able to ingest the following string and remove everything but the financial values in an xml map connector

CIGNA;QPA=242.06

any direction is appreciated. This is for an x12 837 file

---

<div class="post-metadata">

**Author:** ![ericbux](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/ericbux/32/1679_2.png) [@ericbux](https://community.cdata.com/u/ericbux)\
**Post date:** [April 19, 2023, 8:05pm UTC](https://community.cdata.com/t/stripping-financial-values-from-strings-in-and-arc-map/154/2 "2023-04-19T20:05:33Z")

</div>

There’s a pretty good example in the Arc documentation under Scripting \> Formatters \> String Formatters using regex pattern matching.

I would add a script node similar to the example shown

```xml
<arc:set attr="myString" value="[xpath/YOUR_ELEMENT_FOR_REGEX" /><arc:set attr="decimalPattern" value="\[0-9\]+\.?\[0-9\]*" /><arc:set attr="price" value="[myString | regexmatch([decimalPattern])]" />

```

Then in your map you would set the value to [\_map.price]

I would play around with this as I just did a quick and dirty example.

---

<div class="post-metadata">

**Author:** ![wnielson](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@wnielson](https://community.cdata.com/u/wnielson)\
**Post date:** [April 19, 2023, 9:21pm UTC](https://community.cdata.com/t/stripping-financial-values-from-strings-in-and-arc-map/154/3 "2023-04-19T21:21:49Z")

</div>

> [@ericbux](#):
>
> There’s a pretty good example in the Arc documentation under Scripting \> Formatters \> String Formatters using regex pattern matching.
> 
> I would add a script node similar to the example shown
> 
> ```xml
> <arc:set attr="myString" value="[xpath/YOUR_ELEMENT_FOR_REGEX" /><arc:set attr="decimalPattern" value="\[0-9\]+\.?\[0-9\]*" /><arc:set attr="price" value="[myString | regexmatch([decimalPattern])]" />
> 
> ```
> 
> Then in your map you would set the value to [\_map.price]
> 
> I would play around with this as I just did a quick and dirty example.

Thanks! I actually was able to find a little bit of a simpler solution by just setting a custom script to

```xml
<arc:info title="Custom Script" desc="The custom script."> <input name="FilePath" desc="The sending file path." /> <input name="XPath" desc="The current xpath in the loop." /> <input name="*" desc="The information of the current loop." /></arc:info><arc:set attr="qpaString" value="[xpath(PWK/PWK06)]" /><arc:set attr="qpaAmount" value="[qpaString | split('=',2)]" /><arc:set attr="result.text">[qpaAmount]</arc:set>

```
