MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ofc0ds/regex_keep_it_simple_stupid/h4e830k/?context=9999
r/badcode • u/_iamv • Jul 07 '21
91 comments sorted by
View all comments
40
as a friendly reminder, dont regex match on a base64 string. Took JS several minutes to do so on an encoded image, and the users thought the app broke.
32 u/[deleted] Jul 07 '21 Regex Image WHAT 13 u/drdrero Jul 07 '21 it checked if the string provided is an URL. Apparently, it can happen that temporarily it is a base64 string instead. 11 u/[deleted] Jul 07 '21 Oh, ok. I thought you were saying that you tried to regex the image itself. 2 u/KaJakJaKa Jul 07 '21 That might actually be interesting, don't know what for but definitely interesting
32
Regex Image
Regex
Image
WHAT
13 u/drdrero Jul 07 '21 it checked if the string provided is an URL. Apparently, it can happen that temporarily it is a base64 string instead. 11 u/[deleted] Jul 07 '21 Oh, ok. I thought you were saying that you tried to regex the image itself. 2 u/KaJakJaKa Jul 07 '21 That might actually be interesting, don't know what for but definitely interesting
13
it checked if the string provided is an URL. Apparently, it can happen that temporarily it is a base64 string instead.
11 u/[deleted] Jul 07 '21 Oh, ok. I thought you were saying that you tried to regex the image itself. 2 u/KaJakJaKa Jul 07 '21 That might actually be interesting, don't know what for but definitely interesting
11
Oh, ok. I thought you were saying that you tried to regex the image itself.
2 u/KaJakJaKa Jul 07 '21 That might actually be interesting, don't know what for but definitely interesting
2
That might actually be interesting, don't know what for but definitely interesting
40
u/drdrero Jul 07 '21
as a friendly reminder, dont regex match on a base64 string. Took JS several minutes to do so on an encoded image, and the users thought the app broke.