Skip to content

Instantly share code, notes, and snippets.

View paulchaum's full-sized avatar

Paul CHAUMEIL paulchaum

View GitHub Profile
@paulchaum
paulchaum / swile-extract.js
Last active October 8, 2025 16:43
Script JS pour télécharger les transactions de Swile
const extractAmount = (amountStr) => {
let regex;
const language = navigator.language;
if (language.includes("fr")) {
// French
// Replace all spaces with an empty string
amountStr = amountStr.replace(/\s/g, '');
regex = /(?<symbol>[-+])?\s*(?<amount>\d+,\d{2})?\s*(?<currency>€)?\s*/;
} else {
// English