私は次のように文字列を分割しようとしています:
Item A
89798の数字と文字を含む可能性のあるアイテム( )@ $ 550.00
4のItem B
@$420.00
の476584、Item C
数量が多く、通貨記号が異なる@£420.00
の中へ:
array(
0 => 1
1 => "some item which may contain 89798 numbers and letters"
2 => $550.00
);
それは理にかなっていますか?
数量、説明、価格(記号を含む)を分割する正規表現パターンを探しています。
文字列は常に次のようになります。
qty x description @ price+symbol
したがって、正規表現は次のようになると思います。
`(match a number and only a number) x (get description letters and numbers before the @ symbol) @ (match the currency symbol and price)`
これにどのようにアプローチすればよいですか?