<html><head><title>Re: [OpenSIPS-Users] string modification</title>
</head>
<body>
<span style=" font-family:'Times New Roman'; font-size: 12pt;">Hello!<br>
<br>
With var everything fine, thank you.<br>
<br>
 </span><a style=" font-family:'arial'; font-size: 10pt;" href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
<br>
<table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">Hello,<br>
<br>
Try without quotes : $rU = $(rU{re.subst,/-//g});<br>
<br>
Or use var to store your regex.<br>
<br>
</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="http://www.opensips.org/Documentation/Script-Tran-1-11#toc72">http://www.opensips.org/Documentation/Script-Tran-1-11#toc72</a><br>
<br>
<span style=" font-family:'times new roman'; font-size: 12pt;">Regards,<br>
<br>
<br>
On Thu, Oct 6, 2016 at 5:15 AM, Denis &lt;</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="mailto:denis7979@mail.ru">denis7979@mail.ru</a><span style=" font-family:'times new roman'; font-size: 12pt;">&gt; wrote:<br>
</span><table>
<tr>
<td width=2 bgcolor= #3200ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">Hello, Bogdan!<br>
<br>
In a log file i see<br>
Oct &nbsp;6 12:09:56 opensips-mirror /usr/local/opensips2.2/sbin/opensips[6990]: ERROR:core:subst_parser: string too short<br>
Oct &nbsp;6 12:09:56 opensips-mirror /usr/local/opensips2.2/sbin/opensips[6990]: ERROR:core:tr_eval_re: Can't compile regexp<br>
Oct &nbsp;6 12:09:56 opensips-mirror /usr/local/opensips2.2/sbin/opensips[6990]: WARNING:core:do_assign: no value in right expression at /usr/local/opensips2.2//etc/opensips/opensips.cfg:374<br>
<br>
374 string <br>
<span style=" font-size: 9pt;">$rU = $(rU{re.subst,"/-//g"});<br>
<br>
<span style=" font-size: 12pt;">Thank you for any help.<br>
<br>
</span></span></span><a style=" font-family:'times new roman'; font-size: 10pt;" href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
<br>
<table bgcolor="#ffffff">
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">Yes, it is.<br>
<br>
Or you can do it shorter:<br>
 &nbsp; $rU = $(rU{re.subst,"/-//g"});<br>
<br>
Regards<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Founder and Developer<br>
</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><br>
<span style=" font-family:'times new roman'; font-size: 12pt;">On 30.09.2016 13:46, Denis wrote:<br>
</span><table>
<tr>
<td width=2 bgcolor= #3200ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">Re: [OpenSIPS-Users] string modification Thank you, Bogdan<br>
<br>
Just in case, is this correctly?<br>
<br>
$var(input) = $rU;<br>
$var(output)=$(var(input){re.subst,"/-//g"});<br>
$rU=$var(output);<br>
<br>
</span><a style=" font-family:'times new roman'; font-size: 10pt;" href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
<br>
<table bgcolor="#ffffff">
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">Hi,<br>
<br>
The easiest way is by using a regexp substitution (see </span><a style=" font-family:'times new roman'; font-size: 12pt;" href="http://www.opensips.org/Documentation/Script-Tran-2-2#toc81">http://www.opensips.org/Documentation/Script-Tran-2-2#toc81</a><span style=" font-family:'times new roman'; font-size: 12pt;">) :<br>
 &nbsp;<br>
$var(input)="123-45-67";<br>
$var(output) = $(var(input){re.subst,"/-//g"});<br>
<br>
Regards,<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Founder and Developer<br>
</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><br>
<span style=" font-family:'times new roman'; font-size: 12pt;">On 30.09.2016 13:00, Denis wrote:<br>
</span><table>
<tr>
<td width=2 bgcolor= #3200ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 12pt;">string modification Hello!<br>
<br>
I am sorry that it was early, but my question is, how can i delete some character from some string if i do not know where this character will be inside the string?<br>
<br>
For example, input string 123-45-67, or 12-345-67, but output string should be 1234567.<br>
<br>
Thank you.<br>
<br>
<br>
</span><a style=" font-family:'times new roman'; font-size: 10pt;" href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a> <br>
<br>
<span style=" font-family:'times new roman'; font-size: 12pt;">_______________________________________________<br>
Users mailing list<br>
</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a style=" font-family:'times new roman'; font-size: 12pt;" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<span style=" font-family:'times new roman'; font-size: 12pt;">_______________________________________________<br>
Users mailing list<br>
</span><a style=" font-family:'times new roman'; font-size: 12pt;" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a style=" font-family:'times new roman'; font-size: 12pt;" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</td>
</tr>
</table>
<br>
<br>
<br>
<span style=" font-family:'times new roman'; font-size: 12pt;">-- <br>
<span style=" font-family:'arial'; font-size: 11pt; color: #0070c0;"><b>Stas Kobzar<br>
</b><span style=" font-size: 9pt; color: #a6a6a6;">Developeur VoIP / VoIP Developer<br>
<br>
<span style=" font-size: 12pt; color: #0070c0;"><b>Modulis&#173;.ca Inc.<br>
<span style=" font-size: 9pt; color: #000000;"># Bureau / Office: 514-284-2020 x 246<br>
<span style=" font-size: 8pt;">Email</span></span></b><span style=" font-size: 8pt; color: #000000;">: </span></span></span></span></span><a style=" color: #1155cc; text-decoration: normal; font-family:'arial';" href="http://firstname.lastname">s</a><span style=" font-family:'arial'; color: #1155cc;"><u>tas.kobzar@modulis.ca<br>
</u></span><a style=" color: #1155cc; text-decoration: normal; font-family:'arial';" href="https://www.modulis.com/">https://www.modulis.com</a></td>
</tr>
</table>
</body></html>