chinescu has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I need help writing a syntax from a text. Explicitly, my string is this (without quotes): "../AGH-final/agh_merged1_no7.csv"
I need to extract the "agh" portion between last / and first _ by looking for these two referenced characters and getting what is in between. I will need this into one command, e.g. something to be inserted into a code like: $var1 =~ thisMagicSyntax;
Thank you very much!
PS: the AGH and agh parts are texts that are changing, so I can't really use them as a reference of sort s/(?<=agh_)....etc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extract text between two delimiters from a text line
by GrandFather (Saint) on Dec 02, 2011 at 02:31 UTC | |
by chinescu (Initiate) on Dec 02, 2011 at 02:45 UTC |