# Original answer (with small changes)
**EDIT:** I've changed `\fill_body:` to use `\clist_map_variable:NNn` instead of `\int_while_do:nNnn`, so that each `\clist_item:Nn` doesn't have to be grabbed twice. The result is a 6 times faster `\fill_body:`.
I hope the following does what you want, but I'm not sure.
Note that you have to build the token list inside the loop, not the other way around, and have to expand the value of `\l_swar_counter_int` before putting it in the token list variable (otherwise you'll just try to access the last element during output as that will be the current value of the integer variable). But I changed your `\fill_body:` even more using `\clist_map_variable:NNn`.
Also your code doesn't conform with the expl3 naming conventions (and I didn't fix this). The names of your functions and variables should start with the module name like this:
Function:
```
\<module>_<name>:<args>
```
Variable:
```
\<l/g>_<module>_<name>_<type>
```
Here is the code that should work (hopefully):
```
% !TeX program = xelatex
\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\ExplSyntaxOn
\int_new:N \l_swar_counter_int
\clist_new:N \l_swarbol_clist
\clist_new:N \l_swarlist_clist
\tl_new:N \l_swarbol_tl
\tl_new:N \l_antara_body_tl
\cs_new:Npn \extract_swar:n #1
{
\tl_set:Nn \l_swarbol_tl {#1}
\regex_replace_all:nnN {)} {,),} \l_swarbol_tl
\regex_replace_all:nnN
{ \[[\x{0900}-\x{097F}\w,\{ \}]+ \] } {} \l_swarbol_tl
\regex_replace_all:nnN {[(]} {} \l_swarbol_tl
\clist_set:NV \l_swarbol_clist \l_swarbol_tl
\clist_set_eq:NN \l_swarlist_clist \l_swarbol_clist
\fill_body:
}
\cs_generate_variant:Nn \extract_swar:n { f }
\cs_new_protected:Npn \fill_body:
{
\tl_clear:N \l_antara_body_tl
\cs_set_eq:NN \l_swarlist_tmpa_tl \q_nil
\clist_map_variable:NNn \l_swarlist_clist \l_swarlist_tmpb_tl
{
\quark_if_nil:NTF \l_swarlist_tmpa_tl
{
\tl_set_eq:NN \l_swarlist_tmpa_tl \l_swarlist_tmpb_tl
}
{
\str_if_eq:eeTF { \l_swarlist_tmpb_tl } { ) }
{
\tl_put_right:Nx \l_antara_body_tl
{
& \exp_not:n { \multicolumn { 1 } { c } }
{ \exp_not:o \l_swarlist_tmpa_tl }
}
\cs_set_eq:NN \l_swarlist_tmpa_tl \q_nil
}
{
\tl_put_right:Nx \l_antara_body_tl
{
& \exp_not:o \l_swarlist_tmpa_tl
}
\tl_set_eq:NN \l_swarlist_tmpa_tl \l_swarlist_tmpb_tl
}
}
}
\quark_if_nil:NF \l_swarlist_tmpa_tl
{
\tl_put_right:Nx \l_antara_body_tl { & \exp_not:o \l_swarlist_tmpa_tl }
}
}
\cs_new_protected:Npn \antara_print:
{
\begin{tabular}{*{20}{c}}
\l_antara_body_tl
\end{tabular}
}
\NewDocumentCommand \antara { m }
{
\extract_swar:f { #1 }
\antara_print:
}
\ExplSyntaxOff
\begin{document}
\antara{(प,{धंध},j,नीं)[a,b,c,d](प,{धंध},j,d)[a,b,c,d](प,{धंध},j,d)[a,b,c,d](प,{धंध},n,k)[a,b,c,d]}\\
\end{document}
```
# New answer with faster code (still not matching naming conventions)
If you want to replace fixed symbols and not a real regular expression and don't need to replace tokens which are inside of braces, you can use `\tl_replace_all:Nnn` or `\tl_remove_all:Nn`, which are a lot faster than `\regex_replace_all:nnN`. Also you can get a slight speed enhancement by using `\regex_const:Nn` and `\regex_replace_all:NnN` if the regular expression is always the same and you intend to use it often. Also by using a `\q_nil` instead of `)` to mark a closing parenthesis you can use the way faster test `\quark_if_nil:NTF` instead of `\str_if_eq:eeTF`.
```
% !TeX program = xelatex
\documentclass{article}
\usepackage{xparse}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Shobhika}
\ExplSyntaxOn
\clist_new:N \l_swarbol_clist
\clist_new:N \l_swarlist_clist
\tl_new:N \l_swarbol_tl
\tl_new:N \l_swarlist_tmpa_tl
\tl_new:N \l_swarlist_tmpb_tl
\tl_new:N \l_antara_body_tl
\regex_const:Nn \c_swarbol_regex { \[[\x{0900}-\x{097F}\w,\{ \}]+ \] }
\cs_new:Npn \extract_swar:n #1
{
\tl_set:Nn \l_swarbol_tl { #1 }
\tl_remove_all:Nn \l_swarbol_tl { ( }
\tl_replace_all:Nnn \l_swarbol_tl { ) } { , \q_nil , }
\regex_replace_all:NnN \c_swarbol_regex {} \l_swarbol_tl
\clist_set:NV \l_swarbol_clist \l_swarbol_tl
\clist_set_eq:NN \l_swarlist_clist \l_swarbol_clist
\fill_body:
}
\cs_generate_variant:Nn \extract_swar:n { f }
\cs_new_protected:Npn \fill_body:
{
\tl_clear:N \l_antara_body_tl
\cs_set_eq:NN \l_swarlist_tmpa_tl \q_nil
\clist_map_variable:NNn \l_swarlist_clist \l_swarlist_tmpb_tl
{
\quark_if_nil:NF \l_swarlist_tmpa_tl
{
\quark_if_nil:NTF \l_swarlist_tmpb_tl
{
\tl_put_right:Nx \l_antara_body_tl
{
& \exp_not:n { \multicolumn { 1 } { c } }
{ \exp_not:o \l_swarlist_tmpa_tl }
}
}
{
\tl_put_right:Nx \l_antara_body_tl
{ & \exp_not:o \l_swarlist_tmpa_tl }
}
}
\tl_set_eq:NN \l_swarlist_tmpa_tl \l_swarlist_tmpb_tl
}
\quark_if_nil:NF \l_swarlist_tmpa_tl
{
\tl_put_right:Nx \l_antara_body_tl { & \exp_not:o \l_swarlist_tmpa_tl }
}
}
\cs_new_protected:Npn \antara_print:
{
\begin{tabular}{*{20}{c}}
\l_antara_body_tl
\end{tabular}
}
\NewDocumentCommand \antara { m }
{
\extract_swar:f { #1 }
\antara_print:
}
\ExplSyntaxOff
\begin{document}
\antara{(प,{धंध},j,नीं)[a,b,c,d](प,{धंध},j,d)[a,b,c,d](प,{धंध},j,d)[a,b,c,d](प,{धंध},n,k)[a,b,c,d]}\\
\end{document}
```