Write a C program which does wildcard pattern matching algorithm

Write a C program which does wildcard pattern matching algorithm

Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if the two strings match. The following are allowed wild card characters in first string.

* –> Matches with one or more instances of any character or set of characters.
? –> Matches with any single character.

For example, here “f?rmc*” matches with “firmcodes” string. Because it use two ‘*’  characters and single ? which indicates set of characters unknown and single character not known respectively.

 

 

Output

Write a C program which does wildcard pattern matching algorithm

Suggested Reading

  1. Write a C program to reverse the words in a sentence in place
  2. Write your own trim() or squeeze() function to remove the spaces from a string
  3. Write a C program to reverse the string without using strrev() ?

If you like this Article, then don’t forget to Click on Social likes buttons.