Forum > Packages and Libraries

[SOLVED] Base64 Reg Exp using TRegExpr

(1/1)

Gizmo:
I need to parse data for Base64 strings that are not known in advance, so I need to use a reg exp to search for patterns of Base64.

Can anyone convert this Base64 Reg Exp that I found at StackOverflow (http://stackoverflow.com/questions/475074/regex-to-parse-or-validate-base64-data) to TRegExpr syntax because I don't think it will work as is because it's standard grep?


--- Code: ---^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$

--- End code ---

Many thanks

Ted

Gizmo:
This works, in that it returns Base64 data such as : VGhpcyBpcyBhIHNpbXBsZSBBU0NJSSBCYXNlNjQgZXhhbXBsZSBmb3IgU3RhY2tPdmVyZmxvdy4=


--- Code: ---([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)

--- End code ---

Navigation

[0] Message Index

Go to full version