GeeksforGeeks » Interview Questions

Wildcard pattern matching

(1 post)
  • Started 9 months ago by codeman
  1. codeman
    Member
    Posted 9 months ago #

    Allowed wildcard: '*' [0..many]
    Return true if the pattern matches the given string input.

    Constraints: Pattern always starts and ends with a minimum one *

    Ex-1:
    Pattern: *A*
    Source String: ABC
    Return: True

    Ex-2:
    Pattern: *AX*
    Source String: ABC
    Return: False

    Ex-3:
    Pattern: *A*BBBB*
    Source String: ABBBDBBBEBBBFBBBB
    Return: True

    Ex-4:
    Pattern: *A*BBBB*X*
    Source String: 123A213SWBB3sBBBB323X
    Return: True


Reply

You must log in to post.

RSS feed for this topic