|
|
@ -2,11 +2,15 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Create a `groupPrice` function, that can find a price in a given string. |
|
|
|
Create a function named `groupPrice`, that can prices in a given string. |
|
|
|
The function has to return an array of arrays with the full match of the price ($43.99) |
|
|
|
|
|
|
|
and the groups of that price, the first group(43) and the second group (99). |
|
|
|
Your function will return s 2D array with the full price breakdown. |
|
|
|
If there is no match the function returns an empty array. |
|
|
|
|
|
|
|
Example: |
|
|
|
If there is no match, your function should return an empty array. |
|
|
|
"The price is USD12.31" |
|
|
|
|
|
|
|
Expected output: |
|
|
|
### Example |
|
|
|
[["USD12.31","12","31"]] |
|
|
|
Given price of `USD12.31`: |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
[["USD12.31", "12", "31"]] |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|