Link to home
Start Free TrialLog in
Avatar of roger v
roger vFlag for United States of America

asked on

Coldfusion regexp question (kaufmed) - revisited

Hi,

Kaufmed provided me with a neat lil regexp to strip out extra spaces after the 1st and 2nd token. But I did not award him the max points, my mistake! His regexp was the correct requirement. However, I now have an additional piece that I need added. My test string:

dt - tl  -  dist track & sprint - high & middle - 327 -  indoor meet

Kaufmed's regexp now removes the whitespaces after the first t, after the 1st hyphen, after the 1st l and after the 2nd hypen. I need to be able to remove the whitespace after the last hyphen as well. How do I do this? (this way I can also make sure kaufmed gets the full points :)  )
SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way, if you want kaufmed to get full points from the previous question, I think you can use the "Request Attention" link to reopen the question and reassign points - you may need to state your justification for it though.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, it can be shorter:
<cfset myStr=ReReplace(myStr, "^([^ -]+) *- *([^ -]+) *- *(.*-) *", "\1-\2-\3") >

Open in new window