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?

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

 

4
Avatar
Permanently deleted user

Bingo!!!!. Thanks for your help

1

This is nice, but could I also select only the contents of the N-th regex capturing group?

1

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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

请先登录再写评论。