1
Good night to you all.
I would like to know a regular expression for the following information:
Numbering and title of a chapter.
Example:
- INTRODUCTION
number = 1.
title = INTRODUCTION
1.1. GENERAL OBJECTIVE
number = 1.1.
title = GENERAL OBJECTIVE
1.2. SPECIFIC OBJECTIVE
number = 1.2.
title = SPECIFIC OBJECTIVE
I need this to generate a summary in the following format:
- | INTRODUCTION | PAGE
1.1. | GENERAL OBJECTIVE | PAGE
1.2. | SPECIFIC OBJECTIVE | PAGE
That is, the regular expression should be able to recognize numbers followed by dots in the following generic format:
Primary Title => x.
Secondary Title => x.x.
Tertiary Title => x.x.x.
Quaternary Title => x.x.x.x.
And so on and so forth.
Thanks for your attention. I embrace you all.
Have you tried any ? And also depending, can use some DOM parser...
– MagicHat
I tried this: @"[ d]+[. ] .
– Marcelo
I forgot to mention, I’m using the C language#.
– Marcelo
I used this site: http://rubular.com/r/v5TNAzCQKa It works, but when programming in the application it is wrong...
– Marcelo
By the way, what is DOM parser? I looked here and did not find ...
– Marcelo
Peri, here it appears...
– MagicHat
But -- in what format is your text there? You know that the most common is the opposite, right? Special markings in the text of what is title, chapter, etc... generate the numbers (and then generate the titles).
– jsbueno
The posted answer solves your problem. To test expressions, use this online tool: http://www.regexr.com/
– Pagotti