0

I've following problem: I'm trying to replace every occurrence of a string that starts with % and also ends % with, in the middle of the precentage symbols there should be alphanumerical chars. and brackets () allowed. This is what I currently have:

/^%[a-zA-Z0-9()]+%$/

1 Answer 1

1

^%[a-zA-Z0-9()]+%$ would work fine if your percent signs start and end the line. However, I assume this is not the case.

^ means the beginning of a line, $ means the end of a line. I assume you would want just: %[a-zA-Z0-9()]+%

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, the end and start line was seemingly my error! Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.