[SR-Users] Stripping variable amount of digits

Iñaki Baz Castillo ibc at aliax.net
Thu Sep 16 20:06:55 CEST 2010


Hi, I get a prefix string from a database and store it in
$var(prefix). Such prefix can contain any number of digits (no fixed
length).
Now I must to check if the RURI username begins with that prefix and
in that case strip it.

I can get the first step (detect it) using pcre_match function:

  if pcre_match("$rU", "^$var(prefix)") {
    # Prefix match.


But I cannot get the second part working (stripping it). I've tryed everything:

- strip() is not valid as just allows an integer (no pv).

- subst_user() doesn't accept pv:
     if subst_user("/^$var(prefix)(.*)$/\1/")


Any ideas please? Thanks a lot.

-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-users mailing list