Hi I am using this regex pattern “(?<=Module Name:\s)[A-Z]*[#|++|-]?”, Why can;t my condition retrieve 2 ++ at once? I have a module Name that is called C++. When i ran this i only got C+, I can;t seem to retrieve ++ together, I need it to get C++
Here all the parameters like #,+,- has to be enclosed within parantheses and not in square brackets. Because latter will treat them as single character while matching.
For testing either regex101.com or regexr.com can be used that describes what we do.
Try this solution with the next pattern and let me know.
(?<=Module Name:)((.*\n)?)(?=Module Code)
hi @Susana I tried the code you gave me it doesn;t work, am I suppose to add anything else beside the code you gave me? Sorry I am really new to regex…
It is working for me. This attachment
TestExtractTextBetweenLabels.zip (2.2 KB) contains a txt file with the text:
Module Name: ENTREPRENEURSHIP
Module Name: PRINCIPLES OF ACCOUNTING
Module Name: COMMUNICATION SKILLS 2
Module Name: CYBER SECURITY TECHNOLOGY, LAW AND ETHICS
The ouput for the example .xaml is
- PRINCIPLES OF ACCOUNTING
- COMMUNICATION SKILLS 2
- CYBER SECURITY TECHNOLOGY, LAW AND ETHICS
Is this right?
I had not seen your answer, sorry. It is already works? If not, can you share your files to check them? I can not reproduce your problem.
@Susana Hey thanks for replying it is working already, thanks for asking!