Skip to content

Commit

Permalink
using library pcre when it is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Apr 18, 2023
1 parent c59e639 commit 2597b70
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

v3.20.7 (2023-04-18) using library pcre when it is installed
v3.20.6 (2023-04-17) fixing the processing of graffiti for nested surfaces
v3.20.5 (2023-04-17) making the graffity order independent
v3.20.4 (2023-04-17) further fixing the processing of graffiti for nested surfaces and beautifying inference fuse
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.20.6
3.20.7
25 changes: 23 additions & 2 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
:- use_module(library(sha)).
:- use_module(library(dif)).
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(pcre)), _, true).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v3.20.6 (2023-04-17)').
version_info('EYE v3.20.7 (2023-04-18)').

license_info('MIT License

Expand Down Expand Up @@ -12385,8 +12386,28 @@
% Regular expressions
%


regex(Pattern, String, List) :-
catch(regex1(Pattern, String, List), _, regex2(Pattern, String, List)).

% Regular expressions using pcre library
regex1(Pattern, String, List) :-
atom_codes(Pattern, PatternC),
escape_string(PatC, PatternC),
atom_codes(Pat, PatC),
atom_codes(String, StringC),
escape_string(StrC, StringC),
atom_codes(Str, StrC),
re_matchsub(Pat, Str, Dict, []),
findall(Value,
( get_dict(Key, Dict, Value),
Key \== 0
),
List
).

% Regular Expressions inspired by http://www.cs.sfu.ca/~cameron/Teaching/384/99-3/regexp-plg.html
regex(RE_esc_atom, Input_esc_atom, Output_esc_atoms) :-
regex2(RE_esc_atom, Input_esc_atom, Output_esc_atoms) :-
atom_codes(RE_esc_atom, RE_esc),
atom_codes(Input_esc_atom, Input_esc),
escape_string(RE, RE_esc),
Expand Down
Binary file modified eye.zip
Binary file not shown.

0 comments on commit 2597b70

Please sign in to comment.