zorg dat de letter A of B altijd gevolgd wordt door een spatie wanneer het direct gevolgd wordt door een cijfer.

re.sub(r"(A|B)(\d)", r"\1 \2", input_string)

swap values of lat/lon coordinate in Google Sheets

from:  5.11699542 52.09363001
to:   52.09363001, 5.11699542
=REGEXREPLACE(A1,"(\-?\d+\.\d+)\s+(\-?\d+\.\d+)","$2, $1")

get domain

domain = re.findall(r"^.+?[^\/:](?=[?\/]|$)",link)

fuzzy regex

see python

non greedy match in python

matches = re.findall(r'(geboren op )(.*?)( te)(.*?)(,)',text) # non greedy

nice visual regex debugger

non greedy img src url's in textfile in SublimeText

" was escaped in textfile by \". In regex you need to escape the \ as well


only the middle group:


everything before the first digit

result = re.findall(r'^[^\d]*',address)

replace all non-alphanumeric characters by spaces

=trim(regexreplace(REGEXREPLACE(join(" ",B2,D2,E2,F2),"[^a-zA-Z0-9\-]"," "),"\s+"," "))

in sublimetext middelste groep van 3 groepen vinden

dit vind dus alleen B in (A)(B)(C)


Alles na de laatste slash (filename)


Alles voor de laatste slash (pad)


zoek alle GUID's in een tekst


good introduction

find date(s) in a string

//finds one or more instances of dates in this format: 03-04-2018 

add brackets around auto links in md files in SublimeText

Find: http://.*
Replace: <$0>

javascript math id= parameter in querystring

var link = "";
var matches = link.match(/&id=([^&]*)/);
var id = matches ? matches[1] : null;
//result: 138622

regexp pal

javascript parse whitespace

let wc = "        7      1312";

Shiffman about regex

Find all URLs starting with http and ending with .html

this works in the SublimeText search function:


Online tools


expr "ok T:83.4 /0.0 B:0.0 /0.0 @:0" : 'ok T:\([0-9]*\.[0-9]*\)'

sed & cut

grep -o '\(T:\)\([0-9]*\.[0-9]*\)' /tmp/UltiFi/ttyACM0/ temp.out | cut -c 3-
grep "spotify:track:" spotify.json | cut -c 16-51
grep "spotify:track:" spotify.json | head -n 1 | cut -c 16-51    # only first result


see [[awk]]

turing machine with SED