I have a regex where the variable $m_strFirstName
is next to other identifier characters that aren't part of the variable name:
if($strWholeName =~ m/$m_strFirstName_(+)/)
....
I'm trying to extract something like:
- strWholeName is 'bob_jones' or 'bob_smith'
- m_strFirstName is 'bob'
- and I want the 'smith' or 'jones' part of the string.
- if strWholeName is "frank_jones" I want to ignore that, so the if statement would be false
Obviously,
m/$m_strFirstName_(+)/
is not going to work because the regex interpreter won't treat the $m_strname part as I intended, so any ideas?
EDIT: my original question was not clear, updated.
Thanks