Regex question

(imported topic written by len123)

Hi,

i need to create an analysis that need to extract license info from a file. the contents of the file is “A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00%09%004%00W%007%00N%00I%004%00I%00-%00L%00Y%00C%00G%00C%00C%00G%00-%00B%00D%00L%003%009%00G%00C%00-%00K%002%00K%00A%00G%00W%00C%00-%00C%00I%007%00H%00P%00Y%001%00%09%00”

I would like the output to look like this:

4W7NI4I-LYCGCCG-BDL39GC-K2KAGWC-CI7HPY1

i tried using the following statement but im getting nowhere with it

(concatenation “” of (matches (regex “[A-Z0-9]”) of (“A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00%09%004%00W%007%00N%00I%004%00I%00-%00L%00Y%00C%00G%00C%00C%00G%00-%00B%00D%00L%003%009%00G%00C%00-%00K%002%00K%00A%00G%00W%00C%00-%00C%00I%007%00H%00P%00Y%001%00%09%00”)

Any help is greatly appreciated

thanks to all

(imported comment written by IanR2974)

Hi Len,

Not sure if you have extra characters in the string you wish to ignore as when i ran:

Q: concatenation of (substrings before “%00” of “A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00%09%004%00W%007%00N%00I%004%00I%00-%00L%00Y%00C%00G%00C%00C%00G%00-%00B%00D%00L%003%009%00G%00C%00-%00K%002%00K%00A%00G%00W%00C%00-%00C%00I%007%00H%00P%00Y%001%00%09%00” as trimmed string)

A: ABCD-ABCDABCD-ABCD4W7NI4I-LYCGCCG-BDL39GC-K2KAGWC-CI7HPY1

It finds additional characters.

If this preceding text is the same across the board you can use the below to get rid of it:

Q: following text of substring “ABCD-ABCDABCD-ABCD” of (concatenation of (substrings before “%00” of “A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00A%00B%00C%00D%00-%00A%00B%00C%00D%00%09%00%09%004%00W%007%00N%00I%004%00I%00-%00L%00Y%00C%00G%00C%00C%00G%00-%00B%00D%00L%003%009%00G%00C%00-%00K%002%00K%00A%00G%00W%00C%00-%00C%00I%007%00H%00P%00Y%001%00%09%00” as trimmed string))

A: 4W7NI4I-LYCGCCG-BDL39GC-K2KAGWC-CI7HPY1

(imported comment written by IanR2974)

Just to add. I don’t think you will be able to use Regex in this one as it will find the 0’s in %00 as well.

Anyway i hope the above helps if not let me know and i will have another look at it or the regex method.

Thanks,

Ian