Skip to Content
avatar image
Former Member

To filter alphanumeric combination, is it match pattern?

Hi

  I am using BODS 14.1.1.210  .

I would like to filter one column which has the pattern AXXXXX (where X can be number or alphabet or combination of both)

I treid to use match pattern but I X means alphabet and 9 means number but how can I filter all the combinations of numbers or alphabets.

for example;

Input

A12345

A1234567

AabcdE

Aabcde

A12asd

Aas12d

Askljfdadf

Output

A12345

AabcdE

Aabcde

A12asd

Aas12d

Cheers!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 19, 2014 at 01:15 PM

    Hi Josh,

    Instead of match patten use match_regex  for your requirement .  You can use like this .

    OUTPUT = decode(match_regex(INPUT,'[A-Z][A-Za-z0-9]{5}',null)<>0,$INPUT,null );

    You can filter on this column like OUTPUT is not null means you can get matched values.  You need one additional query transform for filter .

    Thanks & Regards,

    Ramana.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Josh ,

      Yes you can use in the where clause like

      decode(match_regex(INPUT,'S[a-zA-Z0-9]{2}-A[a-zA-Z0-9]{6}',null)<>0,INPUT,null ) is not null Instead of adding one more query transform and field.

      Thanks & Regards,

      Ramana.