0
I want to take only the name of the discipline of an H1 containing the following text: "ENF N1A METHODOLOGY OF SCIENTIFIC RESEARCH (MES)". In this case what interests me in this string is the value "CINENTÍFICA RESEARCH METHODOLOGY". The idea I had was to use regex to return this value by taking text from the string set that was larger than x. Someone could tell if this is the best way?
[ADD]
The full names of the disciplines follow the following pattern:
[cod_dis)][""][class][" "][discipline][" "][(cod_branch)]
In this case, for the examples cited I marked in italics the part I would like to take from the whole:
ENF N1A METHODOLOGY OF SCIENTIFIC RESEARCH (MES)
ENF N1A APPLIED INFORMATICS (MES)
ENF N1A INSTRUMENTAL ENGLISH (MES)
Would look like this:
METHODOLOGY OF SCIENTIFIC RESEARCH
APPLIED INFORMATICS
INSTRUMENTAL ENGLISH
P.S. I know that before the discipline there is the class code that has at most 4 characters, and after the discipline, there is the (cod_filial) that always stays in parentheses.
Only
METODOLOGIA DA PESQUISA CIENTÍFICA
? Or some other rule for a list of names and that has some pattern?– danieltakeshi
That example has become a bit vague. I suggest giving more examples of more catches you want to make, to make clearer the rule you are applying
– Isac
I would like to use this same rule to find the name of the other disciplines. I edited the question adding more details. Obg.
– GOliveira
The regex I made is very similar to the answer, see the demo on Regex101. I will not post because the answer is already very good.
– danieltakeshi
I’ll look yes. Thanks a lot @danieltakeshi.
– GOliveira