![]() |
|
[.NET] Very simple REGEX problem - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Very simple REGEX problem (/showthread.php?tid=5448298) |
Very simple REGEX problem - WhatIsRS - Oct 29, 2016 Need help with this string. Pretty much I need to detect if this exact string exists, however the numbers can be anything. How can i do this using regex? Thanks PHP Code Below doesn't work... but it's what im trying to do PHP Code Current work-around: PHP Code * - -SomE. - Oct 29, 2016 Code Try* - WhatIsRS - Oct 29, 2016 (Oct 29, 2016 05:45 PM)-SomE. Wrote: Thanks 👍 * - +Haze - Oct 30, 2016 This isn't a task for regex mate, use a json deserializer to check or just use string#Contains to check if the two keys exists * - Ninja - Oct 30, 2016 JSON deserialization would be much better. Add a reference to System.Web.Extensions and then you can use the System.Web.Script.Serialization.JavaScriptSerializer class. * - mrkoolaid - Oct 30, 2016 pcre php regex Code ([{].{2}total.{2}[:]\d{3}.{3}items.{3}[[][]][}])however i do suggest deserialization as well :) * - Zilog80 - Oct 30, 2016 (Oct 30, 2016 09:38 AM)Ninja Wrote: JSON deserialization would be much better. Add a reference to System.Web.Extensions and then you can use the System.Web.Script.Serialization.JavaScriptSerializer class. Sorry for the off-topic, but I have a question: Are there any advantages referencing to System.Web.Extensions for using System.Web.Script.Serialization.JavaScriptSerializer instead adding a reference to System.Runtime.Serialization for using System.Runtime.Serialization.Json.DataContractJsonSerializer class? Or maybe both classes 'do the same' job? (serialize/deserialize JSON data) PS: I've always used DataContractJsonSerializer class for JSON stuff. * - Ninja - Oct 31, 2016 (Oct 30, 2016 10:10 AM)Zilog80 Wrote: Sorry for the off-topic, but I have a question: I haven't used the latter that much and I am more familiar with the first. As far as advantages go I have no clue. |