Hi,
thanks again. The following patch adds capability of searching with regexes (I get some utf8 errors, but it works. Do you happen to know how to fix them?):
18c18
< my ($recurse, $name, $case,$linenums,$quick_start) =(0,0,0,0,0);
---
> my ($recurse, $name, $case,$linenums,$quick_start, $use_regex) =(0,0
+,0,0,0);
21a22
> if( grep{/\bR\b/} @ARGV ){@ARGV = grep { $_ ne 'R' } @ARGV; $use_reg
+ex = 1 };
64a66
> my $vboxC3 = Gtk2::VBox->new();
83a86,91
> my $checkbutton5 = Gtk2::CheckButton->new('Use RegEx');
> $checkbutton5->signal_connect( clicked =>
> sub{check_button_callback($checkbutton5, \$use_regex ,
+'use_regex')});
> $vboxC2->pack_start( $checkbutton5, 0, 0, 0 );
>
> if($case){$checkbutton5->set_active(1);}
87c95
< $vboxC2->pack_start( $checkbutton4, 0, 0, 0 );
---
> $vboxC3->pack_start( $checkbutton4, 0, 0, 0 );
91a100
> $hboxt->pack_start( $vboxC3, 0, 0, 0 );
284,285c293,307
< if ($case){$regex = qr/\Q$search_str\E/}
< else{$regex = qr/\Q$search_str\E/i}
---
> if ($case){
> if ($use_regex) {
> $regex = qr/$search_str/;
> }
> else {
> $regex = qr/\Q$search_str\E/}
> }
> else {
> if ($use_regex) {
> $regex = qr/$search_str/i;
> }
> else {
> $regex = qr/\Q$search_str\E/i;
> }
> }
Regards,
svenXY
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
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|