RegEx to remove key and certificate headers and footers : <p>I need to strip out the header and footer of key and certificate files (as well as any LF found in the data). Yes, I can use String.Replace for all of the headers and footers but it can be done in one or perhaps two lines using RegEx. My problem is that I know nothing about the RegEx syntax. Can anyone tell me the search pattern to locate the headers (-----BEGIN <em>some variable text</em>-----) and replace them with empty strings? Note the footers all start with -----END.</p>
