regex problem for comments line
- From: Ahmet Kilic <ahmedkilic@xxxxxxxxx>
- Date: Sun, 27 Sep 2009 23:44:07 -0500
str = " uses
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs,
Graphics,
Login_c, Login_i,
Utility_c, Utility_i,
Agent_i,
MMenu, // メニューオブジェクト
CtrlForm, // 画面起動制御
CommonData, // 共有データ保持クラス
ServerAccess, // 通信ラッピング層統括クラス
MasterList, // 名称マスター管理クラス
IniFileAccess, // iniファイル管理クラス
MessageAccess, // 共通メッセージ管理クラス
LogAccess, // ログ出力制御クラス
TelephoneCommand, // 電話制御用コマンドクラス
TelephoneDataClass, // 電話制御用データクラス
ExtCtrls, jpeg, StdCtrls;
type "
str.scan(/^\s*uses\s*$(.*?)\s*,\s*(\S+)\s*;\s*^type/m) do |us|
names = $1
names.split(/,/).each do |name| # split the words(w+) only
sub_name = names.gsub(/\/*\s*(\S+)$/, "") # problem here
I think
puts " ===== sub names ======= #{ sub_name}"
# puts " >>>>>>> here uses #{ name}"
if /(\w+)/m =~ name
ref = $1
var = $1
# puts "@@@@@@@ here uses #{ var}"
if class_name
# puts " class name : #{class_name} reference class
name #{var} "
end
end
end
end
please help me abut this problem. I want to exclude or split the
comments.( japanese comment parts). I tried many combinations but still
problem.
--
Posted via http://www.ruby-forum.com/.
.
- Prev by Date: Re: Getting a valid URL from a command line
- Next by Date: Re: Getting a valid URL from a command line
- Previous by thread: Getting a valid URL from a command line
- Next by thread: Re: regex problem for comments line
- Index(es):
Relevant Pages
|