mirror of
https://github.com/javl/image2cpp.git
synced 2026-07-27 19:56:07 +00:00
Merge pull request #44 from Sebski123/master
Made RegEx matching more general
This commit is contained in:
+3
-3
@@ -821,8 +821,8 @@
|
||||
var input = document.getElementById("byte-input").value;
|
||||
|
||||
// Remove Arduino code
|
||||
input = input.replace(/const unsigned char myBitmap \[\] PROGMEM = \{/g, "");
|
||||
input = input.replace(/\};/g, "");
|
||||
input = input.replace(/const\s+(unsigned\s+char|uint8_t)\s+[a-zA-Z0-9]+\s*\[\]\s*(PROGMEM\s*)?=\s*/g, "");
|
||||
input = input.replace(/\};|\{/g, "");
|
||||
|
||||
// Convert newlines to comma (helps to remove comments later)
|
||||
input = input.replace(/\r\n|\r|\n/g, ",");
|
||||
@@ -833,7 +833,7 @@
|
||||
//Remove comments
|
||||
input = input.replace(/\/\/(.+?),/g, "");
|
||||
// Remove "0x"
|
||||
input = input.replace(/0x/g, "");
|
||||
input = input.replace(/0[xX]/g, "");
|
||||
// Split into list
|
||||
var list = input.split(",");
|
||||
console.log(list);
|
||||
|
||||
Reference in New Issue
Block a user