why [^ ] is not working in $regexp in this program?
i want match any character is not "-" but this code is not working!
please help me
Try without \
Reason - doesn't need to be escaped like you've shown it.
You can use a positive lookahead to get the same result.
This will remove EVERYTHING for the string except -
Use on your files with caution.
Format string: $regexp(%title%,'(?=[^-]).',)
You're right regarding the initial problem. That doesn't work.
Not sure why you want to remove all but a hyphen.
Can you give an example of what you want to achieve?