I'll add something to what jsmorley and eclectic-tech said above, and, as always, I'll say it directly: nearly everyone learns and understands best when experimenting himself, of course based on some key principles that in most cases tell him WHAT certain things do and HOW they can be used (there's the WHEN and WHERE as well, but that's already clear here). That's all one needs to accumulate the knowledge and experience you said some have and you don't, and this is fact, not personal opinion.
That knowledge and experience doesn't come with others solving your problems, but with you trying to do the same, based on those what and how notions, which have been already mentioned several times, in these particular regular expression cases, and which eclectic-tech perfectly summarized for a basic regex:
That knowledge and experience doesn't come with others solving your problems, but with you trying to do the same, based on those what and how notions, which have been already mentioned several times, in these particular regular expression cases, and which eclectic-tech perfectly summarized for a basic regex:
The clues are never the actual code and solutions you were provided with, but the "tools" that were used and the "way" they were used in those solutions and advices. I have the feeling that you still want the former and neglect the latter, while the way to accumulate knowledge and experience is the other way around.Your RegExp tells the parser what characters to look for (actual words), what characters to skip (anything you do not want) using .*, and what characters to capture using (.*) and saves those in incrementing StringIndexes.
Statistics: Posted by Yincognito — Yesterday, 9:58 pm