Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Now, I have data (javascript) the same:
HTML
<script type="text/javascript">var d=[];d=[['123','Product A','$230'],['125','Product B','$30'],['126','Product C','$50']];show(d);</script>


I use C# to regex data to Dictionary:
D[123] = string[] { "Product A", "$230" };
D[125] = string[] { "Product B", "$30" };
D[126] = string[] { "Product C", "$50" };

Can you help me pattern to Regex this data??
Posted
Updated 6-May-13 5:50am
v2
Comments
helmi77 6-May-13 13:49pm    
What do you mean by "pattern to Regex this data". You need a regular expression to retrieve the product data from the javascript section?

1 solution

Is it always the same, or are there any differences?

If not... maybe this could help
\['(.+?)','(.+?)','(.+?)'\]

Be advised, that you need to iterate through the results... and maybe this also could help[^] (even it's quite old ;))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900