Wednesday, 24 May 2017

regex - Getting text from inside an HTML tag within a local file with grep








Excerpt From Input File



Municipality: 

JUPITER


My Regular Expression



(?<=)([^]*)



I have an HTML file saved to disk. I would like to use grep to search through the file and output the contents of a specific span, though I don't know if this is a proper use of grep. When I run grep on the file with the expression read from another file (so I dont mess up escaping any special characters), it doesn't output anything. I have tested the expression in RegExr and it matches "JUPITER" which is exactly what I want returned. Thank you so much for your help!



Desired Output



JUPITER

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...