Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Regex exercise – word delimited by marker

I am a beginner to regex, and cannot understand well how to proceed on the following task. Imagine there is a code with words like follows: "object.foo" and "object.bar()". I am interested to gather all words after the dot preceded by the word "object". The raw text is available here. May you help me write a bash code to collect these words?

Best regards,
Bruno Peixoto

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You could try a positive lookbehind: (?<=object\.)\w* to find all words preceded by object..
Apart from that, I would suggest you look at Regex basics on regex101.com or regexr.com, as pointed out in the comments.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading