Don't ask to ask, just ask | |
PerlMonks |
capture value from two patternsby vitoco (Hermit) |
on Aug 20, 2020 at 19:50 UTC ( [id://11120938]=perlquestion: print w/replies, xml ) | Need Help?? |
vitoco has asked for the wisdom of the Perl Monks concerning the following question: Hi! I usually capture and assign a variable this way:
I need to add another pattern for the same capture because sometimes the string changes:
How could I combine both patterns to get only one capture for both possible sources? Obvously this does not work as it gets 2 captures:
A workaround could be the following:
I want to know I there is a way to get only one capture from two different surrounding strings in a single pattern. Thanks!
Back to
Seekers of Perl Wisdom
|
|