Regex to choose one random occurence of a keyword between a { and } sign -


my text example:

{this text example , keyword, keyword in text multiple times , want 1 of keyword replaced, should chosen randomly every time}

so out of 3 keywords want 1 replaced, chosen randomly. keyword appears more 3 times, once.
possible regex?

no, not possible regex.

you could, however, use regex find of keywords, generate random number, , use number replace 1 occurance.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -