Match the carboxylic acids and leave the esters, the aldehydes and the ketones alone. All four carry a C=O, so the C=O on its own will not do it.
Convert between chemical structures and SMILES in both directions, search a list of structures by substructure or SMARTS, and learn the notation step by step. Everything runs in your browser — no structure you open ever leaves your machine — so the tool needs JavaScript.