1

Extract string between single quotes with sed

view story
linux-howto

http://stackoverflow.com – I have a thousand Delphi files (.pas), and I need to extract text from them. The text I need is between single quotes (Pascal strings), and I only need the strings called from a particular function. E.g.: my_function('This is the string I need') I have extracted all the lines that appear the function and added to a text file, using find and grep, but I'm unable to extract the strings. I've been looking around the Internet for a regex to extract this strings, but I don't know how to do this. I'm trying with this: sed "s/.*my_function\('(.*)'\).*/\1/" all_the_strings.txt > my_out_file.txt (HowTos)