php regex to split invoice line item description
- by user1053700
I am attempting to split strings like the following:
An item (Item A) which may contain 89798 numbers and letters @ $550.00
4 of Item B @ $420.00
476584 of Item C, with a larger quantity and different currency symbol @ £420.00
into:
array(
0 => 1
1 => "some item which may contain 89798 numbers and letters"
2 => $550.00
);
does that make sense?
I am looking for a regex pattern which will split the quantity, description, and price (including symbol).
the strings will always be:
qty x description @ price+symbol
so i assume the regex would be something like:
`(match a number and only a number) x (get description letters and numbers before the @ symbol) @ (match the currency symbol and price)`
How should I approach this?