Generating regular expression
US-2016217121-A1 · Jul 28, 2016 · US
US9760551B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-9760551-B2 |
| Application number | US-201615003723-A |
| Country | US |
| Kind code | B2 |
| Filing date | Jan 21, 2016 |
| Priority date | Jan 22, 2015 |
| Publication date | Sep 12, 2017 |
| Grant date | Sep 12, 2017 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
An example method for generating a regular expression includes: acquiring a preset character string; acquiring a to-be-collected character string in the preset character string in response to a trigger instruction; recognizing a character string before the to-be-collected character string from the preset character string, the character string before the to-be-collected character string being used as a first character string; recognizing a character string after the to-be-collected character string from the preset character string, the character string after the to-be-collected character string being used as a second character string; and generating a regular expression of the to-be-collected character string by a first preset rule according to character features of the to-be-collected character string, the first character string and the second character string. The techniques of the present disclosure generate the regular expression of the character string needed by a user.
Opening claim text (preview).
What is claimed is: 1. A method comprising: acquiring a preset character string; acquiring a to-be-collected character string in the preset character string in response to a trigger instruction; recognizing a character string before the to-be-collected character string from the preset character string, the character string before the to-be-collected character string being used as a first character string; recognizing a character string after the to-be-collected character string from the preset character string, the character string after the to-be-collected character string being used as a second character string; and generating a regular expression of the to-be-collected character string by a first preset rule according to character features of the to-be-collected character string, the first character string, and the second character string. 2. The method of claim 1 , wherein the first preset rule includes: returning a corresponding result and using the corresponding result as a first partial regular expression when the first character string satisfies a second preset rule. 3. The method of claim 2 , wherein the second preset rule includes: returning a first preset identifier when the first character string is not empty, the first character string is composed of numbers, and the to-be-collected character string is empty. 4. The method of claim 2 , wherein the second preset rule includes: returning a first preset identifier when the first character string is not empty, the first character string is composed of numbers, and the first character of the to-be-collected character string is not a number. 5. The method of claim 2 , wherein the second preset rule includes: returning a second preset identifier when the first character string is not empty, the first character string is composed of word characters including letters, and the to-be-collected character string is empty, or the first character of the to-be-collected character string is not a word character. 6. The method of claim 2 , wherein the second preset rule includes: returning a third preset identifier when the first character string is not empty, the first character string is composed of non-empty characters, and the to-be-collected character string is an empty character string, or the first character of the to-be-collected character string is an empty character. 7. The method of claim 2 , wherein the second preset rule includes: returning a fourth preset identifier when the first character string is empty. 8. The method of claim 1 , wherein the first preset rule includes: returning a corresponding result and using the corresponding result as a first partial regular expression when the to-be-collected character string satisfies a third preset rule. 9. The method of claim 8 , wherein the third preset rule includes: returning a fifth preset identifier when the to-be-collected character string is not empty, the first character of the to-be-collected character string is a separator, and the first character string does not include a first character of the to-be-collected character string. 10. The method of claim 8 , wherein the third preset rule includes: returning a sixth preset identifier when the to-be-collected character string is empty. 11. The method of claim 1 , wherein the first preset rule includes: returning a corresponding result and using the corresponding result as a first partial regular expression when the first character string satisfies a fourth preset rule. 12. The method of claim 11 , wherein the fourth preset rule includes: defining a first preset variable; sequentially traversing characters in the first character string; determining whether a respective character in the first character string is a separator; appending the respective character to the first preset variable in response to determining that the respective character is the separator. 13. The method of claim 12 , wherein, when all characters in the first character string are traversed, the fourth preset rule further includes returning the first preset variable. 14. The method of claim 12 , wherein, when the characters in the first character string are not all traversed, and a character string which is not traversed does not include the separators, the fourth preset rule further includes: acquiring the character string which is not traversed in the first character string, and using the character string which is not traversed in the first character string as the first character string. 15. The method of claim 14 , further comprising: appending the returned result to the first preset variable, and returning the first preset variable when the first character string satisfies the second preset rule. 16. The method of claim 14 , further comprising: appending the returned result to the first preset variable, and returning the first preset variable when the first character string satisfies the fourth preset rule. 17. The method of claim 12 , wherein, when the characters in the first character string are not all traversed, and a character string which is not traversed includes a separator, the fourth preset rule further includes: acquiring the character string which is not traversed in the first character string; and separating the character string which is not traversed into a character string before a first separator, the first separator and a character string after the first separator according to the first separator in the character string which is not traversed. 18. The method of claim 17 , wherein the character string before the first separator is used as the first character string, and when the first character string satisfies the second preset rule, the returned result is appended to the first preset variable. 19. A system comprising: a preset character string acquisition unit that acquires a preset character string; a to-be-collected character string acquisition unit that acquires a to-be-collected character string in the preset character string in response to a trigger instruction; a first character string acquisition unit that recognizes a character string before the to-be-collected character string from the preset character string, the character string before the to-be-collected character string being used as a first character string; a second character string acquisition unit that recognizes a character string after the to-be-collected character string from the preset character string, the character string after the to-be-collected character string being used as a second character string; and a regular expression generation unit that generates a regular expression of the to-be-collected character string by a first preset rule according to character features of the to-be-collected character string, the first character string, and the second character string. 20. One or more memories having computer-executable instructions stored thereon, executable by one or more processors, to cause the one or more processors to perform acts comprising: acquiring a preset character string; acquiring a to-be-collected character string in the preset character string in response to a trigger instruction; recognizing a character string before the to-be-collected character string from the preset character string, the character string before the to-be-collected character string being used as a first character string; recognizing a character string after the to-be-collected character string from the preset character string, the character string after
Translation of natural language queries to structured queries · CPC title
Automatic learning of transformation rules, e.g. from examples · CPC title
Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191) · CPC title
Physics · mapped topic
Physics · mapped topic
Related publications grouped by family.
Answers are generated from the same data shown on this page.