Skip to content

Commit

Permalink
more regex fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Jun 11, 2022
1 parent 09c7022 commit 626ce01
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [v0.5.0] - 2022-06-11 10:05:43

### Added

### Changed

- fixed regex search again, perhaps

### Removed

### Deprecated

# ────────────────────────────────────────────────────────────────────────────────────
## [v0.5.0] - 2022-06-10 18:51

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Glyphy"
uuid = "e3b492bb-b251-48f2-9293-5b5772365208"
authors = ["cormullion <[email protected]>"]
version = "0.5.0"
version = "0.6.0"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
5 changes: 3 additions & 2 deletions src/Glyphy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ function glyphy(s::String;
showall = false )
# filter looks at values
# if it doesn't look like a regex
if all(c -> isletter(c) || isdigit(c) || isspace(c) || isequal(c, "-"), map(Char, s)) == true
if all(c -> isletter(c) || isdigit(c) || isspace(c) || isequal(c, '-') || isequal(c, '<'), map(Char, s)) == true
# don't do a regex
hitvalues = filterview(v -> occursin(s, v), unicodedict)
else
# do a regex
hitvalues = filterview(v -> occursin(Regex(s, "i"), v), unicodedict)
rgx = Regex(s, "i")
hitvalues = filterview(v -> occursin(rgx, v), unicodedict)
end
# result is another Dictionary{Int64, String}
if isempty(hitvalues)
Expand Down

0 comments on commit 626ce01

Please sign in to comment.