in reply to Re: Question on Regular Expression
in thread Question on Regular Expression

What is the difference between them? The difference is code snippet 2 is using one more named capture <P_NEW_MON_CODE>. What output are they supposed to give? Code snippet 1 is gving output as (value 'RS S') Value of p_rootcode in Pattern 1 is : RS R Code snippet 2 is gving output as below (no value printed) Value of p_rootcode in Pattern 2 is : Why oneliner regex, why not you use /x? How can I hope to use regular expressions without creating illegible and unmaintainable code? Sorry about that. Why did you use named patterns with $^MATCH? And with code callbacks? Named patterns used for saving the sub matches so that it can be used in later part of the code. Why did you use \K twice? Please ignore this as even if \K is not used still both code snippets are behaving same. Have you heard of rxrx? In this example it doesnt help why the output values are different.