Class: Regexp
- Inherits:
-
Object
- Object
- Regexp
- Defined in:
- lib/old/old_executor.rb,
lib/rust/parsers/bash/stdlibext.rb,
lib/naksh/stdlibext.rb
Class Method Summary collapse
-
.from_perl(perl_compatible_regexp) ⇒ Object
This file is part of Naksh.
- .from_posix(posix_compatible_regexp) ⇒ Object
- .from_unix_expression(unix_expr) ⇒ Object
-
.join(re_list, preserve_options = true) ⇒ Object
This file is part of Naksh.
Instance Method Summary collapse
Class Method Details
.from_perl(perl_compatible_regexp) ⇒ Object
This file is part of Naksh.
Naksh is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Naksh is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Naksh. If not, see <www.gnu.org/licenses/>.
19 20 21 |
# File 'lib/naksh/regexp.rb', line 19 def Regexp.from_perl(perl_compatible_regexp) raise NotImplementedError end |
.from_posix(posix_compatible_regexp) ⇒ Object
24 25 26 |
# File 'lib/naksh/regexp.rb', line 24 def Regexp.from_posix(posix_compatible_regexp) raise NotImplementedError end |
.from_unix_expression(unix_expr) ⇒ Object
29 30 31 |
# File 'lib/naksh/regexp.rb', line 29 def Regexp.from_unix_expression(unix_expr) raise NotImplementedError end |
.join(re_list, preserve_options = true) ⇒ Object
This file is part of Naksh.
Naksh is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Naksh is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Naksh. If not, see <www.gnu.org/licenses/>.
19 20 21 22 23 24 25 26 27 |
# File 'lib/rust/parsers/bash/stdlibext.rb', line 19 def Regexp.join(re_list,=true) raise ArgumentError,"Regexp.join: 1st argument should be an array #{re_list}" unless re_list.respond_to? :collect and re_list.respond_to? :join re_list.collect! do |re| re= Regexp.new(Regexp.escape(re)) if re.kind_of? String re= Regexp.new(re) unless re.kind_of? Regexp ? re.to_s : '(?:'<<re.source<<')' end Regexp.compile(re_list.join('').gsub(/\(\?[\w\-]*\:\)/,'')) end |