Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for string matching based on regular expression

A string matching and expression technology, applied in the field of data processing, can solve the problems of cumbersome design process and difficult maintenance, and achieve the effect of simple design, simplified design process and convenient maintenance.

Active Publication Date: 2012-07-25
北京神州数码云科信息技术有限公司
View PDF4 Cites 24 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In practical applications, when performing text matching, it is necessary to write different string matching structures according to different matching contents. The design process is cumbersome, and once the format of the matching content is changed, the string matching structure needs to be redesigned, resulting in difficulty in maintenance.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for string matching based on regular expression
  • Method and device for string matching based on regular expression
  • Method and device for string matching based on regular expression

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0049] The technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and through specific implementation methods.

[0050] The embodiment of the present invention allocates the types of matching strings according to the characteristics of the arrangement of the matching strings, and performs different regular expression generation and string matching operations according to different types, so as to realize the purpose of simplifying the design process of the string matching structure.

[0051]Wherein, the embodiment of the present invention divides the matching mode of the matching character string into a line mode and a segment mode according to the separation feature of the matching character string. Among them, the matched content in the matching string whose matching mode is a segment mode is repeated according to a certain fixed format, that is, the character combination is repeated in the same format in the...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for string matching based on a regular expression, which includes steps of 100, judging whether matching type of matching string is a segment mode or a line mode and setting a matching type mark; 200, dividing the matching string into a plurality of substrings by means of segment or line according to the matching type mark, determining a regular expression generating mode for each substring, generating a substring regular expression by using different connection regular expressions to connect phrases according to the regular expression generating mode, and obtaining a regular expression list at least comprises one substring regular expression; and 300, dividing data to be matched by means of segment or line according to the matching type mark to obtain the substring to be matched, matching the substring to be matched according to the substring regular expression and outputting matching results.

Description

technical field [0001] The invention relates to the field of data processing, in particular to a string matching method and device based on regular expressions. Background technique [0002] A regular expression is a regular method for describing a string pattern, which can be used for text matching, specifically to find a part in a given string that matches a given regular expression. Regular expressions are composed of ordinary characters and metacharacters. Ordinary characters include numbers and uppercase and lowercase letters, and metacharacters are characters with special meanings. For example, "\s" means any blank character, including spaces, tabs, Form feed character, etc., "." indicates any character except the newline metacharacter "\n", and "*" indicates that the preceding subexpression is repeated zero or more times. Regular expressions can be used for text matching, specifically to find the part that matches the regular expression in a given string. Regular ex...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 刘磊
Owner 北京神州数码云科信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products