Skip to content

Commit

Permalink
Switch from regexp to re
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyg committed Jul 11, 2010
1 parent c8c0610 commit ad599bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rfc4627_jsonrpc_http.erl
Expand Up @@ -124,8 +124,8 @@ extract_timeout_header(HeadersJsonObj) ->


extract_object_and_method(AliasPrefix, Path) -> extract_object_and_method(AliasPrefix, Path) ->
AliasPrefixRe = "^" ++ AliasPrefix ++ "/", AliasPrefixRe = "^" ++ AliasPrefix ++ "/",
case regexp:first_match(Path, AliasPrefixRe) of case re:run(Path, AliasPrefixRe) of
{match, 1, Length} -> {match, [{0, Length}]} ->
ObjectMethod = string:substr(Path, Length + 1), ObjectMethod = string:substr(Path, Length + 1),
case lists:reverse(string:tokens(ObjectMethod, "/")) of case lists:reverse(string:tokens(ObjectMethod, "/")) of
[] -> {<<>>, <<>>}; [] -> {<<>>, <<>>};
Expand Down

0 comments on commit ad599bf

Please sign in to comment.