I have a string input to my program of the form:
con*.cc
I want this to represent the regular expression, con.*.cc.
How can I do this inside a C program? Is there something like sed that I can use?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m guessing you really just want globbing rather than full on regular expressions. If you’re running under Linux, you can use the glob function. I imagine there’s a more portable way of doing it, but I don’t know of one offhand.