Skip to content

Instantly share code, notes, and snippets.

Avatar

Emanuel Regnath emareg

View GitHub Profile
@emareg
emareg / regex-migrate-bs-4-to-5.py
Created May 26, 2021
Migrate Bootstrap 4 to 5 via RegEx
View regex-migrate-bs-4-to-5.py
# table for regex replacements
tabRegEx=[
[r"ml(-\d)", r"ms\1"],
[r"mr(-\d)", r"me\1"],
[r"pl(-\d)", r"ps\1"],
[r"pr(-\d)", r"pr\1"],
[r"data-toggle=([\"'](?:collapse|dropdown|tab)[\"'])", r"data-bs-toggle=\1"],
[r"data-target=", r"data-bs-target="],
["float-left", "float-start"],
["float-right", "float-end"],