REGEX Recipe Ingredient Decode

Cancelled Posted Jun 16, 2015 Paid on delivery
Cancelled Paid on delivery

Hello,

I am looking for somebody to write a regex script/function that will decode recipe ingredients into Ingredient, Modifiers, Amount, Unit. The problem is that not all recipes have the ingredients in the same format ex:

1 avocado // no units (assume each) also no modifiers

2 cups all purpose flour, sifted // has everything

olive oil // no amount, units, nor modifiers

brown sugar 2.5 cups // reversed, no modifier

brown sugar 2 1/2 cups // mixed number

brown sugar 2½ cups //mixed number with special char

2 #10 cans of tomato soup

tomato soup #10 can

I am hoping to have this written in php and if possible to have comments included to edit myself if I find a format not covered.

I know it cannot be perfect and will not catch all cases, could it give me an error flag if not found.

I can include a list of all units and modifiers I know of to assist.

PHP Software Architecture

Project ID: #7874580

About the project

3 proposals Remote project Active Jun 18, 2015

3 freelancers are bidding on average $238 for this job

rajeshsonisl

Hello! With 98% to 99% completion rate, 800+ successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 average rating, can be verified on my profile page [login to view URL] More

$526 USD in 3 days
(580 Reviews)
7.7
optimizmo

Hello, I believe RegExp is not usable here. At least, what first comes to mind is that a more complicated algorythm is needed, such as testing each pattern for matching multiple parameters. I can think of this, if you More

$100 USD in 2 days
(19 Reviews)
4.6
deescorp

Your requirement cant be fullfil by regex, but it can be possible by function, I can write a fuction that will seperate all. lets start

$88 USD in 3 days
(1 Review)
1.4