Hi guys,
i need replace all specified characters (in this case its "N") between the square parentheses by the question mark ("?"). I have dynamic/variable string mask, for example something like CON[NNNN][YYYY] and as output i need to get CON[????][YYYY]. So simply explained replace everything between parentheses by specified sign as many times as the length of match is.
I'm looking for something like:
preg_replace("/\[N+\]/","?","CON[NNNN][YYYY]");
As expected, this pattern replaces just match [NNNN] by one ? instead of [????].
Thanks for any reply.
i need replace all specified characters (in this case its "N") between the square parentheses by the question mark ("?"). I have dynamic/variable string mask, for example something like CON[NNNN][YYYY] and as output i need to get CON[????][YYYY]. So simply explained replace everything between parentheses by specified sign as many times as the length of match is.
I'm looking for something like:
preg_replace("/\[N+\]/","?","CON[NNNN][YYYY]");
As expected, this pattern replaces just match [NNNN] by one ? instead of [????].
Thanks for any reply.
Comment