find position of variable from message template and extract value of it
₹1500-12500 INR
Cancelled
Posted over 6 years ago
₹1500-12500 INR
Paid on delivery
1st Example - With simple text
this is template
Your transaction of <amount> Rs is successfully sent to <user> Your account balance is <finalBalance> Rs
Actual Message is
Your transaction of 50 Rs is successfully sent to rajdeep kumar Your account balance is 20 Rs
--------------------------------------------
2nd Example - With json output
Template
{"data":{"amount":"<amount>","name":"<name>","finalBalance":"<finalBalance>"}}
Actual Message
{"data":{"amount":"50","name":"Rajdeep Kumar","finalBalance":"20"}}
3nd Example - With xml output
<!--?xml version="1.0" encoding="UTF-8"?-->
<data>
<amount><amount></amount>
<name><name></name>
<finalBalance><finalBalance></finalBalance>
</data>
Actual Message
<!--?xml version="1.0" encoding="UTF-8"?-->
<data>
<amount>50</amount>
<name>Rajdeep Kumar</name>
<finalBalance>20</finalBalance>
</data>
I want to find position of variable and extract value of variable . Here variable is <amount> , <name> and <finalBalance>
Just treat all example as string only.
Please do not use any xml or json decoding method , Just do a single coding which will apply in all type of string and find variable.
Hi,
I have gone through the details and also through the attachment. I can do this job for you but not sure. What we are exactly talking about without viewing the real data.
Relevant Skills and Experience
I have 3+ years of experience in Website development and designing. Please check my profile to know more about me.
Proposed Milestones
₹2250 INR - on final delivery
I will develop a regular expression to find and extract the values you need from the strings, without needing to treat them as actual XML or JSON, just as strings every time.
Relevant Skills and Experience
I've used regular expressions for various projects and in different languages. For your project, I think we could do it either with JS or PHP.
Proposed Milestones
₹5999 INR - Project completion
Hi,
I coded a PHP function doing exactely what you need.
It finds a string between 2 given strings.
For example:
$name = find_string("<name>", "</name>").
It will return the found string to variable $name.
Very easy and powerfull. Please contact me.
Regards,
Ozzy
i will do your work within your budget using javascript or php
Relevant Skills and Experience
php, javascript, html, css , mysql
Proposed Milestones
₹7777 INR - quality work is my first preference