Ir al contenido principal

Entradas

Mostrando las entradas etiquetadas como parse

Tokens V2

Tokens: Programme to discover tokens, where there are not. Now available at  https://puszcza.gnu.org.ua/projects/tokens/ This is Version 2, for  version 1, go here . Synopsis: use TokensV2; sub printFile; my @FORMAT = ( ['<Message Date=".*?" Time=".*?" DateTime=".*?" SessionID=".*?"><From>(?:<User FriendlyName=".*?"/>)+</From><To>(?:<User FriendlyName=".*?"/>)+</To><Text(?: Style=".*?")?>.*?</Text></Message>',   sub {     my $fh = $_[1];     my ($d, $t, $f, $s, $T) = $_[0] =~ m|<Message Date="(.*?)" Time="(.*?)" DateTime=".*?" SessionID=".*?">(<From>(?:<User FriendlyName=".*?"/>)+</From>)<To>(?:<User FriendlyName=".*?"/>)+</To><Text(?: Style="(.*?)")?>(.*?)</Text></Message>|;     my $F = join '<br />', ...

Tokens - programa en Perl para parsear XML

Sinopsis use Tokens; open my $regex_fh, '&lt;', $ARGV[0]; #regex.txt open my $target_fh, '&lt;', $ARGV[1]; #file.txt my $target; {   local $/ = undef;   $target = &lt;$target_fh&gt;; #the content   $target =~ s/\n/ /g; } my $regex; {   local $/ = undef;   $regex = &lt;$regex_fh&gt;; #the content } printAll parse $target, $regex;   Códio (archivo: Tokens.pm): =pod  Copyright 2013 Gabriel Czernikier     This program is free software: you can redistribute it and/or modify     it under the terms of the GNU General Public License as published by     the Free Software Foundation, either version 3 of the License, or     (at your option) any later version.     This program is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Se...