JPH0594476A - String search control method - Google Patents

String search control method

Info

Publication number
JPH0594476A
JPH0594476A JP3256154A JP25615491A JPH0594476A JP H0594476 A JPH0594476 A JP H0594476A JP 3256154 A JP3256154 A JP 3256154A JP 25615491 A JP25615491 A JP 25615491A JP H0594476 A JPH0594476 A JP H0594476A
Authority
JP
Japan
Prior art keywords
regular
search
expression
regular expression
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP3256154A
Other languages
Japanese (ja)
Inventor
Minoru Inachi
稔 稲地
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HOKKAIDO NIPPON DENKI SOFTWARE KK
NEC Solution Innovators Ltd
Original Assignee
HOKKAIDO NIPPON DENKI SOFTWARE KK
NEC Software Hokkaido Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HOKKAIDO NIPPON DENKI SOFTWARE KK, NEC Software Hokkaido Ltd filed Critical HOKKAIDO NIPPON DENKI SOFTWARE KK
Priority to JP3256154A priority Critical patent/JPH0594476A/en
Publication of JPH0594476A publication Critical patent/JPH0594476A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

(57)【要約】 【目的】正規表現による検索機能をオペレーティングシ
ステムで吸収し、検索機能を持ったプログラムの規模を
小さくし、性能の優れた正規表現の規制を統一する。 【構成】検索機能を持ったプログラム101が文字列1
02と正規表現103をパラメータとしてオペレーティ
ングシステム104の機能であるところの正規表現検索
手段105は正規表現検索準備手段106を起動し、正
規表現解析手段108及び正規表現変換手段109によ
って正規内部表現112を生成する。その後に正規内部
表現検索手段107が起動され、正規内部表現解釈手段
116及び文字列検索手段111によって文字列検索を
行う。 【効果】本発明は正規表現の規制をオペレーティングシ
ステムで統一でき、検索機能を持ったプログラムの規模
が大きくなることなく性能が向上できるという効果があ
る。
(57) [Summary] [Purpose] To absorb the search function by regular expressions in the operating system, reduce the scale of programs with search functions, and unify the regulations for regular expressions with excellent performance. [Structure] Program 101 with search function is character string 1
02 and regular expression 103 as parameters, the regular expression search means 105, which is a function of the operating system 104, activates the regular expression search preparation means 106, and the regular expression analysis means 108 and regular expression conversion means 109 convert the regular internal expression 112. To generate. After that, the regular internal expression searching means 107 is activated, and the regular internal expression interpreting means 116 and the character string searching means 111 perform a character string search. [Effect] The present invention has the effect that the regulation of regular expressions can be unified in the operating system, and the performance can be improved without increasing the scale of the program having the search function.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は文字列検索制御方式に関
し、特に電子計算機システムにおける検索機能を有する
プログラムの正規表現を使用した文字列検索制御方式関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a character string search control system, and more particularly to a character string search control system using a regular expression of a program having a search function in an electronic computer system.

【0002】[0002]

【従来の技術】文字列の検索機能を持つプログラムの多
くでは、文字列の検索のために正規表現を採用してい
る。正規表現とは、検索パターンの構成要素として超文
字と呼ばれる特別な意味を持つ文字を使用して一意に決
まらない検索文字列の指定を可能とするものである。従
来のプログラムの正規表現による検索の一例を図2に示
す。図2において201は検索機能をもったプログラ
ム、202は検索の対象となる文字列、203は検索パ
ターンとしての正規表現、204は正規表現を使用して
文字列を検索する手段、205は正規表現の意味を解釈
する手段を表す。一般の正規表現による検索機能をプロ
グラム201では、正規表現の規則や正規表現による検
索機能をプログラム201の内部に持っている。プログ
ラム201の検索機能を起動すると、文字列を検索する
手段204は検索の対象となる文字列202と正規表現
203を取り込み、正規表現の意味を解釈する手段20
5を起動しながら検索を行っていく。
2. Description of the Related Art Many programs having a character string search function employ a regular expression for searching a character string. A regular expression allows a search character string that is not uniquely determined to be specified by using a character having a special meaning called a super character as a constituent element of a search pattern. FIG. 2 shows an example of a conventional program regular expression search. In FIG. 2, 201 is a program having a search function, 202 is a character string to be searched, 203 is a regular expression as a search pattern, 204 is a means for searching a character string using a regular expression, and 205 is a regular expression. Means to interpret the meaning of. The program 201 has a general regular expression search function, and the program 201 has a regular expression rule and a regular expression search function. When the search function of the program 201 is activated, the means 204 for searching a character string fetches the character string 202 to be searched and the regular expression 203 and interprets the meaning of the regular expression 20.
Search is performed while starting 5.

【0003】[0003]

【発明が解決しようとする課題】従来の正規表現を用い
た検索機能を持つプログラムでは、正規表現の規則、正
規表現による検索手段をプログラム内部に持ち、プログ
ラムによって正規表現の指定方法が異なっていることが
多いという問題が発生している。また、正規表現の規則
は複雑であるために検索機能のコードサイズは肥大化し
やすく、処理能力も遅くなるという欠点がある。
In a conventional program having a search function using a regular expression, a regular expression rule and a search means based on the regular expression are provided inside the program, and the method of designating the regular expression differs depending on the program. The problem is that there are many cases. In addition, since the regular expression rules are complicated, the code size of the search function tends to become large, and the processing capacity becomes slow.

【0004】本発明の目的は以上の欠点を解消して、正
規表現による検索機能を持ったプログラムの正規表現の
指定方法を統一し、プログラムにコードサイズが大きく
なることなく高速な正規表現による検索機能を持つ文字
列検索制御方式の提供することにある。
The object of the present invention is to solve the above drawbacks, to unify the method of designating a regular expression of a program having a search function using a regular expression, and to perform a fast regular expression search without increasing the code size of the program. It is to provide a character string search control method having a function.

【0005】[0005]

【課題を解決するための手段】本発明の文字列検索制御
方式は、電子計算機のオペレーティングシステムにおい
て、正規表現を入力して正規表現を解析する正規表現解
析手段と、前記正規表現解析手段の結果を元に電子計算
機が扱い易い表現である正規内部表現に変換する正規表
現変換手段と、前記正規表現解析手段と前記正規表現変
換手段とを起動して正規表現による文字列検索の前準備
を行う正規表現検索準備手段と、前記正規表現検索準備
手段によって得られた正規内部表現を解釈する正規内部
表現解釈手段と、検索の対象となる文字列を入力して前
記正規内部表現解釈手段の結果を元に文字列の検索を行
う文字列検索手段と、前記正規内部表現解釈手段と前記
文字列検索手段とを起動して正規内部表現に合致した文
字列を検索する正規内部表現検索手段と、前記オペレー
ティングシステム上で動作するプログラムの要求によっ
て前記正規表現検索準備手段と前記正規内部表現検索手
段とを起動して正規表現による文字列検索を行う正規表
現検索手段から構成され、オペレーティングシステム上
で動作するプログラムに統一した前記正規表現検索手段
を提供して検索機能を持つプログラムの検索指示を統一
して構成される。
According to the character string search control method of the present invention, in an operating system of an electronic computer, a regular expression analyzing means for inputting a regular expression and analyzing the regular expression, and a result of the regular expression analyzing means. A regular expression conversion means for converting into a regular internal expression which is an expression easy to handle by an electronic computer, and the regular expression analysis means and the regular expression conversion means are activated to prepare for a character string search by a regular expression. Regular expression search preparing means, regular internal expression interpreting means for interpreting the regular internal expression obtained by the regular expression search preparing means, and a character string to be searched are input and the result of the regular internal expression interpreting means is input. A character string search unit that searches for a character string, a regular internal expression interpretation unit, and the character string search unit are activated to search for a character string that matches the regular internal expression. It is composed of an internal expression search means and a regular expression search means for activating the regular expression search preparation means and the regular internal expression search means in response to a request of a program operating on the operating system to perform a character string search by a regular expression. The regular expression search means unified to the programs operating on the operating system is provided, and the search instructions of the programs having the search function are unified.

【0006】[0006]

【実施例】以下本発明の詳細を、その実施例につき図面
を参照して説明する。
The details of the present invention will be described below with reference to the accompanying drawings.

【0007】図1は、正規表現検索手段の処理内容を示
すフローチャートである。図3は、正規表現検索手段の
処理内容を示すフローチャードである。図1において1
01は検索機能を有するプログラム、102は検索の対
象となる文字列、103は検索パターンとしての正規表
現、104は電子計算機のオペレーティングシステム、
105は正規表現検索手段、106は正規表現検索準備
手段、107は正規内部表現検索手段、108は正規表
現解析手段、109は正規表現変換手段、110は正規
内部表現解釈手段、111は文字列検索手段、112は
正規内部表現である。
FIG. 1 is a flowchart showing the processing contents of the regular expression search means. FIG. 3 is a flowchart showing the processing contents of the regular expression search means. 1 in FIG.
01 is a program having a search function, 102 is a character string to be searched, 103 is a regular expression as a search pattern, 104 is an operating system of a computer,
Reference numeral 105 is a regular expression search means, 106 is a regular expression search preparation means, 107 is a regular internal expression search means, 108 is a regular expression analysis means, 109 is a regular expression conversion means, 110 is a regular internal expression interpretation means, and 111 is a character string search. Means, 112 is a regular internal expression.

【0008】検索機能を有するプログラム101は、検
索の対象となる文字列102と検索パターンとしての正
規表現103をパラメータとして、電子計算機のオペレ
ーティングシステム104が提供する機能であるところ
の正規表現検索手段105を呼び出す。図3は正規表現
検索手段105の処理内容を示したフローチャートであ
る。まずステップ301で検索が前回の継続であるか、
そうでないかの判断を行い、前回の継続でない場合はス
テップ302で検索プターンとしての正規表現をパラメ
ータとして正規表現検索準備手段106を起動する。ス
テップ303で正規表現検索準備手段が正常に終了した
か判断する。正規表現に誤りがあればステップ304で
エラー処理を行う。
The program 101 having the search function uses the character string 102 to be searched and the regular expression 103 as the search pattern as parameters, and the regular expression search means 105 which is a function provided by the operating system 104 of the computer. Call. FIG. 3 is a flowchart showing the processing contents of the regular expression search means 105. First, in step 301, is the search continued last time?
If it is not continued, the regular expression search preparation means 106 is started in step 302 using the regular expression as a search pattern as a parameter. In step 303, it is determined whether the regular expression search preparation means has been completed normally. If there is an error in the regular expression, error processing is performed in step 304.

【0009】ここで、正常に終了していたならばステッ
プ302の結果として得られる正規内部表現と検索の対
象となる文字列を、パラメータとしてステップ305で
正規内部表現検索手段を起動する。ステップ305の結
果をステッ306で判断し検索に成功していればステッ
プ308で検索に失敗したことを報告する。
Here, if the processing has been completed normally, the regular internal expression search means is activated in step 305 using the regular internal expression obtained as a result of step 302 and the character string to be searched as parameters. If the result of step 305 is judged in step 306 and the search is successful, step 308 reports that the search has failed.

【0010】そして、正規表現検索準備手段106は、
正規表現解析手段108を起動して、正規表現の正当性
をチェックする。正規表現解析手段108が正常に終了
したならば、正規表現検索準備手段106は、正規表現
変換手段109を起動して正規表現を電子計算機が扱い
易い形式であるところの正規内部表現112に変換す
る。正規内部表現検索手段107は、まず正規内部表現
解釈手段110によって正規内部表現113を解釈し、
その情報と検索の対象となる文字列103をパラメータ
として文字列検索手段を起動して文字列の検索を行う。
Then, the regular expression search preparation means 106 is
The regular expression analysis means 108 is activated to check the validity of the regular expression. When the regular expression analysis means 108 is completed normally, the regular expression search preparation means 106 activates the regular expression conversion means 109 to convert the regular expression into the regular internal expression 112 in a format that is easy for the computer to handle. .. The regular internal expression searching means 107 first interprets the regular internal expression 113 by the regular internal expression interpreting means 110,
Using the information and the character string 103 to be searched as a parameter, the character string search means is activated to search for the character string.

【0011】このように、文字列検索制御方式は、正規
表現による検索機能を電子計算機のオペレーティングシ
ステムの機能として提供するため、検索機能を有するプ
ログラムの規模を小さくすることができ、各プログラム
の正規表現の規則を統一することができる。しかも、正
規表現は電子計算機が扱い易い形式である正規内部表現
に変換されてから使用されるため、大量の文字列を対象
とした検索においても高い性能を持つことができる。
As described above, since the character string search control system provides the search function by the regular expression as a function of the operating system of the electronic computer, the scale of the program having the search function can be reduced, and the regular function of each program can be reduced. The expression rules can be unified. Moreover, since the regular expression is used after being converted into the regular internal expression which is a format that can be easily handled by the electronic computer, it can have a high performance even in the search for a large amount of character strings.

【0012】[0012]

【発明の効果】以上説明で明らかな如く、本発明の文字
列検索制御方式は、正規表現による検索機能を持ったプ
ログラムの正規表現の指定方法を統一し、プログラムの
コードサイズが大きくなることなく高速な正規表現によ
る検索機能を提供できるという効果がある。
As is apparent from the above description, the character string search control method of the present invention unifies the method of designating a regular expression of a program having a search function using a regular expression without increasing the code size of the program. This has the effect of providing a high-speed regular expression search function.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の文字列検索制御方式の一実施例の構成
を示すブロック図
FIG. 1 is a block diagram showing the configuration of an embodiment of a character string search control system of the present invention.

【図2】従来の検索機能を有するプログラムの処理を示
すブロック図
FIG. 2 is a block diagram showing the processing of a conventional program having a search function.

【図3】正規表現検索手段の処理内容を示したフローチ
ャート
FIG. 3 is a flowchart showing the processing contents of regular expression searching means.

【符号の説明】[Explanation of symbols]

101,201 検索機能を有するプログラム 102,202 検索の対象となる文字列 103,203 検索パターンとしての正規表現 104 電子計算機のオペレーティングシステム 105 正規表現検索手段 106 正規表現検索準備手段 107 正規内部表現検索手段 108 正規表現解析手段 109 正規表現変換手段 110 正規内部表現解釈手段 111 文字列検索手段 112 正規内部表現 204 正規表現による比較を行う手段 205 正規表現を解釈する手段 301 検索が前回の継続であるかの判断 302 正規表現検索準備手段の起動 303 正規表現検索準備手段が正常に終了したかの
判断 304 正規表現検索準備手段が以上終了したことの
報告 305 正規内部表現検索手段の起動 306 正規内部表現検索手段が成功したかの判断 307 検索された文字列の返却 308 検索の失敗の報告
101, 201 Program having search function 102, 202 Character string to be searched 103, 203 Regular expression as search pattern 104 Computer operating system 105 Regular expression search means 106 Regular expression search preparation means 107 Regular internal expression search means 108 regular expression analysis means 109 regular expression conversion means 110 regular internal expression interpretation means 111 character string search means 112 regular internal expression 204 means for performing comparison by regular expressions 205 means for interpreting regular expressions 301 whether the search is a previous continuation Judgment 302 Activation of regular expression search preparation means 303 Determination of whether regular expression search preparation means ended normally 304 Reporting that regular expression search preparation means ended above 305 Activation of regular internal expression search means 306 Regular internal expression search means Was successful Return of the judgment 307 searched string 308 search of the failure report

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 電子計算機のオペレーティングシステム
において、正規表現を入力して正規表現を解析する正規
表現解析手段と、前記正規表現解析手段の結果を元に電
子計算機が扱い易い表現である正規内部表現に変換する
正規表現変換手段と、前記正規表現解析手段と前記正規
表現変換手段とを起動して正規表現による文字列検索の
前準備を行う正規表現検索準備手段と、前記正規表現検
索準備手段によって得られた正規内部表現を解釈する正
規内部表現解釈手段と、検索の対象となる文字列を入力
して前記正規内部表現解釈手段の結果を元に文字列の検
索を行う文字列検索手段と、前記正規内部表現解釈手段
と前記文字列検索手段とを起動して正規内部表現に合致
した文字列を検索する正規内部表現検索手段と、前記オ
ペレーティングシステム上で動作するプログラムの要求
によって前記正規表現検索準備手段と前記正規内部表現
検索手段とを起動して正規表現による文字列検索を行う
正規表現検索手段から構成され、オペレーティングシス
テム上で動作するプログラムに統一した前記正規表現検
索手段を提供して検索機能を持つプログラムの検索指示
を統一して成ることを特長とする文字列検索制御方式。
1. An operating system of a computer, a regular expression analyzing means for inputting a regular expression to analyze the regular expression, and a regular internal expression which is an expression which is easy for a computer to handle based on a result of the regular expression analyzing means. A regular expression conversion means for converting into a regular expression conversion means, a regular expression search preparation means for activating the regular expression analysis means and the regular expression conversion means to prepare for a character string search by a regular expression, and the regular expression search preparation means. A regular internal expression interpreting means for interpreting the obtained regular internal expression; a character string searching means for inputting a character string to be searched and performing a character string search based on a result of the regular internal expression interpreting means; A regular internal expression searching means for activating the regular internal expression interpreting means and the character string searching means to search for a character string matching the regular internal expression; and the operating system. A program operating on an operating system, which comprises a regular expression search means for activating the regular expression search preparation means and the regular internal expression search means in response to a request from a program operating on a system to perform a character string search using a regular expression. A character string search control method, characterized in that the regular expression search means unified into the above is provided to unify search instructions of a program having a search function.
JP3256154A 1991-10-03 1991-10-03 String search control method Pending JPH0594476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3256154A JPH0594476A (en) 1991-10-03 1991-10-03 String search control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3256154A JPH0594476A (en) 1991-10-03 1991-10-03 String search control method

Publications (1)

Publication Number Publication Date
JPH0594476A true JPH0594476A (en) 1993-04-16

Family

ID=17288661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3256154A Pending JPH0594476A (en) 1991-10-03 1991-10-03 String search control method

Country Status (1)

Country Link
JP (1) JPH0594476A (en)

Similar Documents

Publication Publication Date Title
US11520800B2 (en) Extensible data transformations
CN115878003B (en) Method and system for automating RPA webpage operation based on Transformer
US12298996B2 (en) Facilitating data transformations
US12386849B2 (en) Efficient transformation program generation
US11809223B2 (en) Collecting and annotating transformation tools for use in generating transformation programs
JPH10232875A (en) Database management method and parallel database management system
CN113807077A (en) Natural language test script parsing and processing method, device and electronic device
JPH06188405A (en) Data analysis support system of vlsi process
CN106570095A (en) XML data operation method and device
CN113419721A (en) Web-based expression editing method, device, equipment and storage medium
US20100082587A1 (en) Apparatus, method, and computer program product for searching structured document
CN113449067B (en) Data query method, device, equipment and medium
JP2000163602A (en) Input history storage device
US7523031B1 (en) Information processing apparatus and method capable of processing plurality type of input information
CN115168399A (en) Data processing method, device, device and storage medium based on graphical interface
JPH06180717A (en) Database search method
US20240160633A1 (en) Computer-readable recording medium storing information processing program, information processing method, and information processing device
CN121722869A (en) Information retrieval method and device, storage medium and electronic equipment
JPH11259460A (en) Document processing device
JPH0567049A (en) External command processor
JPH0749880A (en) Database access request device
JP3087699B2 (en) Standard information simple input system and standard information simple input method
JP2002287966A (en) Data item dictionary generation method
CN120067128A (en) Database statement generation method and related equipment based on natural language processing
CN122195827A (en) Test data generation method, device, equipment and medium based on UI design prototype file