Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Update: Just had to make a correction for multiple matches on one line...

perl -ne 'while (/(\w*_\w*)/g) { print "$1\n";}' code_file(s)

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...

Mapping into a hash using:

perl -ne 'BEGIN { my %hash; }; END { print map { "$_\n"} keys %hash} while (/(\w*_\w*)/g) { $hash{$1}=1};' code_file(s)

Gives all the unique names, e.g.

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
A Monk aims to give answers to those who have none, and to learn from those who know more.

In reply to Re: extracting words with certain characters by space_monk
in thread extracting words with certain characters by geek09

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (15)
    As of 2015-07-01 18:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (16 votes), past polls