sloppyhack
Technical User
I'm trying to truncate a string at a non-alphanumeric character to include the most characters to still be within a 30 character maximum. It's being greedy even though I'm using the "?" non-greedy version of the quantifier.
Here's the string....
BIT|DRL|6MM|12.8CM|CTR|CNRSTN-SR AM|D11MM|SPNL|DISP
Here's the regex....
/[^a-z0-9].{21,}?$/i
It's matching on "|DRL|6MM|12.8CM|CTR|CNRSTN-SR AM|D11MM|SPNL|DISP". I want it to match on "|CNRSTN-SR AM|D11MM|SPNL|DISP". I can't get it to do a non-greedy match while archoring the expression the end of the string?
Cheers,
Sloppyhack
Here's the string....
BIT|DRL|6MM|12.8CM|CTR|CNRSTN-SR AM|D11MM|SPNL|DISP
Here's the regex....
/[^a-z0-9].{21,}?$/i
It's matching on "|DRL|6MM|12.8CM|CTR|CNRSTN-SR AM|D11MM|SPNL|DISP". I want it to match on "|CNRSTN-SR AM|D11MM|SPNL|DISP". I can't get it to do a non-greedy match while archoring the expression the end of the string?
Cheers,
Sloppyhack