Return True if Pattern is found anywhere within Text - Help

Hi,

I am formulating a DPL command to return true if a pattern such as a credit card format/number exists anywhere within a piece of text.

For example…

data record(a = "378282246310005")
| parse a, """CREDITCARD:cc"""
| fieldsAdd hasCreditCard = isNotNull(cc)

… this would return true, but the minute I add anything before or after it will return false. Any ideas on how to detect that pattern anywhere within a piece of text, or a log? Which is where this code/function is going to be used.

@badgerfifteen I think you just have your parse command incorrect, and you need to add LD* (Line data, optional):

data record(a = "x378282246310005")
| parse a, """LD* CREDITCARD:cc"""
| fieldsAdd hasCreditCard = isNotNull(cc)

Thanks, this works! I used this and changed and changed LD to DATA to account for log entries or pieces of text with new lines.