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.
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 https://www.freelancer.com/u/rajeshsonisl.html !!)... you can never go wrong choosing me :)
I look forward to your reply.
Thanks.
Kind Regards,
Rajesh Soni
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 are interested. Regards, Alexander