Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- Date: Thu, 19 Jan 2006 10:48:32 +0900
- From: Edward Middleton <edward@example.com>
- Subject: Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- References: <43CDFC16.7030808@example.com> <877j8x7mtt.fsf@example.com>
- User-agent: Mail/News 1.5 (X11/20060113)
Stephen J. Turnbull wrote: > Perl probably has a split function; make the kanji string a varaible > (see below for why), and split it on "" which will give you an array > of characters. Then do a join with "\$w". > > (defun mung-run-perl (kanji) > (interactive "sTarget: ") > (search-forward "# comment on line before kanji_string" > (forward-line 1) > (kill-line 1) ;; remove the existing "$kanji_string =" line > (insert " $kanji_string = " kanji ";") ; does perl need a terminating ;? whatever > (save-buffer) > (shell-command (buffer-file-name)) > ) > Thats what my somewhat verbose example was doing. $linestart='p........00.-'; @example.com = split(/ */, Encode::decode_utf8(shift)); $sep = join('','(?:\n',$linestart,'|\.)*'); $start = join('','(',$linestart,'[^\n]*', shift @example.com ); $end = '[^\n]*)'; while($_= shift @example.com){ $middle=join '',$middle,$sep,$_; } $regexp=join('',$start,$middle,$end); Edward
- Follow-Ups:
- Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- From: Stephen J. Turnbull
- References:
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] about sanitize_e820_map()
- Next by Date: Re: [tlug] Editing Soud Files (WAV & MP3)
- Previous by thread: Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- Next by thread: Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links