Minify JSON while protecting string value whitespace

Published on Tue Mar 01 2022

I use it so that I don't need to worry about formatting when working with unit tests in Kotlin, which means I don't worry too much about whether this is production quality, but it could be useful in other situations where the desire is to strip whitespace from a JSON object while protecting the values of stings which have whitespace.

Additional matching regexes for
Minify JSON while protecting string value whitespace

Minify JSON while protecting string value whitespace

I use it so that I don't need to worry about formatting when working with unit tests in Kotlin, which means I don't worry too much about whether this is production quality, but it could be useful in other situations where the desire is to strip whitespace from a JSON object while protecting the values of stings which have whitespace.

URL infos

A powerful regex (fewest steps possible) which gives you all the information about urls.

Two or more whitespace

Reeplace all two or more whitespace in string with a single chararter(ej. one whitespace)

trim string

trim leading and trailing whitespace from a string

Extract url GET parameters

Returns key/value pair of a url. Also works with google fonts which has additional information

JSON validator

Takes a JSON string and captures interesting information in the named capturing groups: (o: last object, a: last array, s: last string, n: last number, c: last comma before optional whitespace, d: same as c, but with a colon instead of a comma, v: last value)

Element's Attribute Value in XML (simple)

Simple regular expression for extracting attribute value of the element in XML-string. Attribute value should be in quotes.

Text out of all sort of brackets (or in) SUPPORTS: { } [ ] ( ) < >

## I made the description in a CSS file which can be viewed [here](https://drive.google.com/uc?export=view&id=1Dal1yMicNV114JY2u-Y7eC34nlO1y1P_) Dont worry its not a virus or anything\, just inspect the source if you are suspicious \:\)

How to document a regex? Example 1

How to document a regex? Example 1: undocumented Regex which works with my test string

Regex to find if/while constructs

Find if/while in JS code written in PCRE