Regular expression matching method and system
a matching method and regex technology, applied in the field of data processing, can solve the problems of low matching performance, too many storage resources, and the matching method consumes too much time and storage resources, and achieves the reduction of the effect of reducing the time consumed by data loading in the matching process and reducing the time consumed by data loading
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Benefits of technology
Problems solved by technology
Method used
Image
Examples
embodiment 1
[0030]A regex matching method is provided in an embodiment of the present invention to shorten the time consumed by data loading in the regex matching process and improve the matching performance. As shown in FIG. 2, the method includes the following steps:
[0031]201. Sort multiple regexes into several regex groups, where all regexes in one regex group include a common string, which is known as a generic string.
[0032]202. Compile each regex group into a DFA, and set up a correlation between the generic string of each regex group and the DFA.
[0033]203. Match to-be-matched data streams with the generic string respectively, and use the matched generic string as a matched string.
[0034]204. Obtain a DFA corresponding to the matched string.
[0035]205. Perform regex matching for the to-be-matched data streams according to the DFA, and output a matching result.
[0036]The string mentioned herein refers to the meaning represented by a combination of printable characters and non-printable characters
embodiment 2
[0038]A regex matching method is provided in an embodiment of the present invention to shorten the time consumed by data loading in the regex matching process and improve the matching performance. As shown in FIG. 3, the method includes the following steps:
[0039]301. Sort multiple regexes into several regex groups when the matching condition includes the multiple regexes, where all regexes in one regex group include a common string, and this string is used to differentiate regex groups and is known as a generic string.
[0040]In step 301, any regexes that include the same string are sorted into a group, regardless of the string itself.
[0041]For example, if a string indicating that “data needs to include ace” exists in two regexes, the two regexes are sorted into a group.
[0042]Further, if the regexes that include the same string are more than a preset threshold, these regexes are sorted into multiple groups, each group consisting of the regexes less than the preset threshold. Therefore, i
embodiment 3
[0072]A regex matching system is provided in an embodiment of the present invention to shorten the time consumed by data loading in the regex matching process and improve the matching performance. As shown in FIG. 4, the system includes:
[0073]a grouping and compiling device A, configured to: sort multiple regexes into several regex groups, where all regexes in one regex group include a common string, which is known as a generic string; and compile each regex group into a DFA, and set up a correlation between the generic string of each regex group and the DFA; and
[0074]a matching device B, configured to: match to-be-matched data streams with the generic string respectively, and use the matched generic string as a matched string; obtain a DFA corresponding to the matched string; and perform regex matching for the to-be-matched data streams according to the DFA, and output a matching result.
[0075]As shown in FIG. 5, the grouping and compiling device A includes:
[0076]a grouping module 501,
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap