in reply to Re: Regex help/ Lua parse
in thread Regex help/ Lua parse
Thank you for your detailed response.
Read and bookmarked perlstyle.
$line =~ /^\s*names\s*=\s*{\s*([^}]+)/; (my $names = $1) =~ y/" //d; my @tags = split /,/ => $names;
^ I figured that my original method could be reduced, but I couldn't seem to figure out how to go about it. This is definitely a much more elegant solution. Thank you for your reference to Quote-Like-Operators. I do have a question though about:
I have seen this construct before on PerlMonks. I did a search and found Use of parentheses around a variable, but wasn't sure how it applied to regexps. Is there a specific name for this method of assignment that I can use to better my search results? Concepts are easily read, but I feel like I learn most by having my code reviewed by the talented and experienced monks. Thank you again for taking the time out to provide guidance in my learning.(my $names = $1) =~ y/" //d;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex help/ Lua parse
by kcott (Archbishop) on Oct 27, 2012 at 04:55 UTC |