changeset 501:f26485a3692c

add String.literal to quote regex
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 18 May 2015 23:23:01 -0600
parents ab9c2afefb47
children d3183a330ff5
files core/src/luan/modules/String.luan
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/src/luan/modules/String.luan	Mon May 18 20:59:30 2015 -0600
+++ b/core/src/luan/modules/String.luan	Mon May 18 23:23:01 2015 -0600
@@ -1,5 +1,6 @@
 java()
 local StringLuan = require "java:luan.modules.StringLuan"
+local Pattern = require "java:java.util.regex.Pattern"
 
 unicode = StringLuan.unicode
 char = StringLuan.char_
@@ -10,6 +11,7 @@
 gmatch = StringLuan.gmatch
 gsub = StringLuan.gsub
 len = StringLuan.len
+literal = Pattern.quote
 lower = StringLuan.lower
 match = StringLuan.match
 matches = StringLuan.matches