in reply to Re^2: Regex to ignore comment
in thread Regex to ignore comment
With an input string such as:
this would remove everything after (and including) the last # of your string:pattern = the number is #8 # number
but this assumes that you always have a trailing comment in your input.s/#[^#]+$//;
But we have not way to know whether it will work with your other input lines (i.e. if there is always a trailing comment in your lines).
|
|---|