Re: help about regex matching



Thanks for Charles.That code can work well,but I still want to know
how to do it with regex expression.

2005/11/29, Charles K. Clarkson <cclarkson@xxxxxxxxxx>:
> Jeff Pang <mailto:jeffpyh@xxxxxxxxx> wrote:
> : I would like to use regex for my destination because the file
> : size is large and having much lines.
>
> An unnecessary regex would slow you down on a large file.
>
>
> HTH,
>
> Charles K. Clarkson
> --
> Mobile Homes Specialist
> 254 968-8328
>
> No regex needed:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> while ( <DATA> ) {
> chomp;
> printf "%-5s% 15s", $_, scalar <DATA>;
> scalar <DATA>;
> }
>
> __END__
> 356.5
> 192.168.2.20
>
> 283.3
> 192.168.2.21
>
> 261.9
> 192.168.2.22
>
> 135.9
> 192.168.2.23
>
> 557
> 192.168.2.24
>
> 79.4
> 192.168.2.25
>
> 349
> 192.168.2.26
>
> 265.1
> 192.168.2.27
>
> 326
> 192.168.2.28
>
> 404
> 192.168.2.29
>
> 331
> 192.168.2.30
>
> 612
> 192.168.2.31
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
> For additional commands, e-mail: beginners-help@xxxxxxxx
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
.



Relevant Pages

  • Re: best design for parse
    ... Dim _regex As New ... Although the application does not exactly know before hand what format the ... format and identifier I can use regex,replace to normalize the date. ... relevant regex expression to be used for date normalization later in part ...
    (microsoft.public.dotnet.languages.vb)
  • Re: need help with regex
    ... >i have a regex expression: ... The problem with your regex is that the first ".*" originally matches ... backtrack in order to match the rest of the pattern--but it only ... You do need to add a quantifier to the subexpression, ...
    (comp.lang.java.programmer)
  • Re: RegEx problem
    ... A quick test with a loop and two timestamps will show you why! ... Regex can do beautiful things, but isn't the best tool for every problem. ... I'm not sure if a int.TryParse would impact the loop you tried enough to make is slower than a regex though, my guess is that it's still faster than a regex. ... I think it must be the last part of my regex expression. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: best design for parse
    ... 1.copy the date format string regex string holder and then derive the ... relevant regex expression to be used for date normalization later in part 2: ...
    (microsoft.public.dotnet.languages.vb)
  • Return Data Regex Doesnt Isolate - Yikes
    ... I'm having a bad regex day and can sure use your help, ... I have a Regex expression that works fine. ... data from the start of a string begining with 200~ to the end of the string ... Here's some test data ...
    (microsoft.public.dotnet.languages.csharp)