Copy all text from find using regex option

Is there a way to copy all the matches found using Find and regex option and paste just that text to another file?

5 comments

Possible with Find in Path using Export to text file button:

 

it produces a report like this:

 

Targets
Occurrences of '"([^"]+)":' in Current File with mask '*.json'
Found Occurrences (6 usages found)
(6 usages found)
a.json (6 usages found)
2 "тест": 123,
3 "year": 2018,
4 "month": 9,
5 "day": 24,
6 "startHours": 6,
7 "startMinutes": 0

 

Or, you can select all occurrences in Find tool window and hit Ctrl+C

0

Thank you for looking, but that's not what I am looking for.

When I use your suggestion, I get the entire line in the file.   I would then have to remove the unwanted text, make sure there is only 1 per per line.

But thanks for your help.

0

As an example, this is a snippet of the report and what I would still need to filter out if I use this regex pattern \{\{.*\}\}

 20 <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
40 <div class="flash-{{ type }} alert alert-{{ type }}">
61 <script src="{{ asset('js/main.js') }}"></script>
mobile-landing.html.twig (14 usages found)
28 <link rel="stylesheet" href="{{ asset('css/reset.css') }}">
33 <link rel="stylesheet" href="{{ asset('css/mobile-landing.css') }}"/>
36 <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
123 globalStuff.customer.carrier = "{{ carrier|default('none') }}";
127 globalStuff.lat = {{ location_info.lat|default('null') }};
128 globalStuff.lon = {{ location_info.lon|default('null') }};
0

Ok, another try then (this time using Find): you can select all found occurrences using Select All Occurrences button (Ctrl+Alt+Shift+J in <default> keymap) and then hit Ctrl+C

 

1

Bingo!!!!. Thanks for your help

1

Please sign in to leave a comment.