[OpenSIPS-Devel] [ opensips-Patches-3513129 ] Regexp support in transformations

SourceForge.net noreply at sourceforge.net
Fri Mar 30 10:08:32 CEST 2012


Patches item #3513129, was opened at 2012-03-30 01:08
Message generated for change (Tracker Item Submitted) made by nikbyte
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=3513129&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: trunk
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Nobody/Anonymous (nobody)
Summary: Regexp support in transformations

Initial Comment:
Based on kamailio textops module regexp support in transformations implementation by Elena-Ramona Modroiu (asipto.com).

{re.subst,expression}
Perform Perl-like substitutions on string value pseudo-variables.
# Assign Request-URI user to PV
$var(user) = $(ru{re.subst,/^sip:(.*)@(.*)/\1/});
# Assign Request-URI user to PV, where every 'A' has been replaced by 'a'
$var(user) = $(rU{re.subst,/A/a/g});
The prototype is:
{re.subst,/match_expression/replacement_expression/flags}
match_expression - Posix regular expression
replacement_expression - substitution expression with back references to matched tokes: \1, \2, …, \9
flags:
i - match ignore case
s - match within multi-lines strings
g - replace all matches


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=3513129&group_id=232389



More information about the Devel mailing list