V
V
veryoriginalnickname2021-09-26 11:51:19
Regular Expressions
veryoriginalnickname, 2021-09-26 11:51:19

How to allow only alphanumeric in {}?

There is an expression that matches only what is in curly brackets: [^{}]+(?=})
How to remake this expression so that only alphanumeric matches in curly brackets, and not everything in general?
upd: I changed the expression for golang, because the expression above did not work for it
now like this:
(?s){(.*?)}
now two questions:
1. How can only alphanumeric be allowed inside curly braces?
2. How to remove curly braces from matching? So that only what is inside them matches? (as in the expression at the very beginning of the question)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
veryoriginalnickname, 2021-09-26
@veryoriginalnickname

main issue resolved:
{([a-zA-Z0-9]*)}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question