in reply to How Do I Skip Spaces At The End of Words Using A Regex?
You've told us what you want to ignore. Now tell us what you want to match. What are you actually trying to do? Give us a good description and sample of the input data, and explain what you wish to match, and to what outcome. Another component of your question ought to tell us what you're wishing to use pattern matching for. You could be matching to reject non-compliant strings, or you could be matching to capture a portion of a string, or you could be matching to verify that a string contains a necessary component, or, or, or... (there are lots of reasons, and they partially dictate the solution).
Update:
I see you've added to your original post... will try to give a more thorough answer once I comprehend what you've added.
Update2:
Try changing my $y = "....... to the following:
my $y = quotemeta( '...........' );
The problem is that many of the characters in your $y string are special characters, interpreted in a special way within regular expressions, unless you "escape" the special characters. quotemeta does that for you.
Dave
|
|---|