I'm trying to write a grep command to find lines like the below in a large text file:
<div class="node_thumbnail" data-type="file" name="GOPR0036.MP4_frame000001.jpg" data="813334c25191468c9f1c57afc99fde60" aid="133948" rel="/Files/ToolTipView?fileId=813334c25191468c9f1c57afc99fde60&pageNo=1&NoCache=101016083044" rev="topMiddle">
but the +
symbol seems to be causing problems in the below commands:
grep 'data=[a-z,0-9,\"]' file
Lots of hits
grep 'data=[a-z,0-9,\"]+' file
No hits
LC_ALL="C" grep ...
instead ofgrep ...
, so that [a-z] means always ascii letters a to z (ie, all lowercase ascii letters) instead of funny alternatives (ex: every letters except "Z", in some locales...)[a-z,0-9,\"]
contains 2 occurence of ",", which is not necessary. you can have the same effect with[a-z,0-9\"]