<?xml version="1.0" encoding="windows-1252"?>
<node id="1007056" title="Re: extracting words with certain characters" created="2012-12-04 05:44:37" updated="2012-12-04 05:44:37">
<type id="11">
note</type>
<author id="880879">
space_monk</author>
<data>
<field name="doctext">
&lt;p&gt;Update: Just had to make a correction for multiple matches on one line...&lt;/p&gt;

&lt;code&gt;perl -ne 'while (/(\w*_\w*)/g) { print "$1\n";}' code_file(s)
&lt;/code&gt;
&lt;br/&gt;


&lt;p&gt;You may want to change the regex to accept only names with a leading alpha character, or so it must contain at least one alpha character, or save the names into a hash to remove duplicates, so YMMV from what I've produced here...
&lt;/p&gt;

&lt;p&gt;Mapping into a hash using:&lt;/p&gt;
&lt;code&gt;perl -ne 'BEGIN { my %hash; }; END { print map { "$_\n"} keys %hash} while (/(\w*_\w*)/g) { $hash{$1}=1};' code_file(s)
&lt;/code&gt;

&lt;p&gt;Gives all the unique names, e.g.&lt;/p&gt;
&lt;code&gt;no_wait
ZERO_TABLE_SIZE
subpart_name
segment_config
__END__
skip_table_list
rnc_dspp_dspresu
range_end
dry_run
gp_partition_drop
keep_empty
ignore_table_list
get_lock
FULL_DATE_FORMAT
get_summarised_days
log_init
tv_interval
get_partition_row_count
drop_agg_level
table_name
total_table_size
keep_summarised
summarisation_log
DATE_FORMAT
get_config
MAX_CACHE_TIME
lock_table
skip_tables
GPM_BIN
day_count
drop_daily_agg_level
lock_attempt
get_dbh
get_drop_partition_list
agg_level
lock_type
schema_name
_
site_perl
empty_only
partition_name
range_start
drop_partition
keep_unclassified
time_zone
pm_nsn_3g_ran
row_count
GPI_RECOVER_BACKLOG
&lt;/code&gt;



&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-880879"&gt;
A Monk aims to give answers to those who have none, and to learn from those who know more.
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1007053</field>
<field name="parent_node">
1007053</field>
</data>
</node>
