Skip to content
Prev 343177 / 398513 Next

regex pattern assistance

On Aug 15, 2014, at 11:56 AM, Tom Wright <tom at maladmin.com> wrote:

            
Tom,

If not in the same relative position, is the substring pattern always the same? That is 3 characters, a hyphen, then 3 characters? If so, would any other part of the path follow the same pattern or is it unique?

If the pattern is the same and is unique in the path:
[1] "S01-012"


is another possible alternative and more flexible:

y <- "/mnt/AO/AO Data/Another Level/Yet Another Level/S01-012/120824/"
[1] "S01-012"


z <- "/mnt/AO/AO Data/Another Level/Yet Another Level/S01-012/One More Level/120824/"
[1] "S01-012"
Stackoverflow?  ;-)

Regards,

Marc