Skip to content

Instantly share code, notes, and snippets.

OliverF

Block or report user

Report or block OliverF

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@OliverF
OliverF / JBeamToJSON.cs
Created Sep 30, 2015
In BeamNG.drive, the configuration files use the proprietary standard "JBeam", which is very similar to JSON but with more relaxed rules. This C# function converts JBeam strings into JSON, so that they can be parsed and edited easily by some 3rd party JSON library. There's some lazy programming here that could be cleaned up, but I have since sto…
View JBeamToJSON.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
private static string JBeamToJSON(string jbeamtext)
{
jbeamtext = Regex.Replace(jbeamtext, @"//.*\r\n", delegate(Match match)
{
You can’t perform that action at this time.