Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f93e23

Browse files
authored
Merge pull request#166 from fancy-regex/prepare_release
Prepare changelog for next releaseplus tidy up a few things: Oniguruma tests and `\Z`
2 parents66a3f90 +0ac0f62 commit6f93e23

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

‎CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66
This project adheres to[Semantic Versioning](http://semver.org/spec/v2.0.0.html),
77
with the exception that 0.x versions can break between minor versions.
88

9+
##[Unreleased]
10+
###Added
11+
- Support`\Z` - anchor to the end of the text before any trailing newlines. (#148)
12+
- Support`\O` - any character including newlines. (#158)
13+
- The parser can now parse subroutine calls and relative backreferences (but execution is still unsupported). This is preparation for future work. Some new error variants have been added for features which can be parsed but are still otherwise unsupported.
14+
- Backreferences can now be case insensitive. (#160)
15+
-`RegexBuilder`: Add options for`multi_line`,`ignore_whitespace`,`dot_matches_new_line` (#165)
16+
###Fixed
17+
- Fix infinite loop when backtracking limit is hit (#153)
18+
- Fix`RegexBuilder.case_insensitive` not always applying when it should. (#163)
19+
- The`toy` example has had various bugfixes, and unit tests added. (#152,#159)
20+
921
##[0.14.0] - 2024-10-24
1022
###Added
1123
- Add`split`,`splitn` methods to`Regex` to split a string into substrings (#140)
@@ -187,6 +199,7 @@ with the exception that 0.x versions can break between minor versions.
187199
- Initial release
188200

189201

202+
[Unreleased]:https://github.com/fancy-regex/fancy-regex/compare/0.14.0...HEAD
190203
[0.14.0]:https://github.com/fancy-regex/fancy-regex/compare/0.13.0...0.14.0
191204
[0.13.0]:https://github.com/fancy-regex/fancy-regex/compare/0.12.0...0.13.0
192205
[0.12.0]:https://github.com/fancy-regex/fancy-regex/compare/0.11.0...0.12.0

‎src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<'a> Parser<'a> {
481481
end,
482482
Expr::LookAround(
483483
Box::new(Expr::Delegate{
484-
inner:"\n*$".to_string(),
484+
inner:"\\n*$".to_string(),
485485
size:0,
486486
casei:false,
487487
}),
@@ -1205,7 +1205,7 @@ mod tests {
12051205
p("\\Z"),
12061206
Expr::LookAround(
12071207
Box::new(Expr::Delegate{
1208-
inner:"\n*$".to_string(),
1208+
inner:"\\n*$".to_string(),
12091209
size:0,
12101210
casei:false,
12111211
}),

‎tests/oniguruma.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::panic;
55

66
use regex::Regex;
77

8-
use fancy_regex::RegexasFancyRegex;
8+
use fancy_regex::RegexBuilder;
99

1010
#[derive(Debug,Eq,Hash,PartialEq)]
1111
structTest{
@@ -151,7 +151,7 @@ fn run_test(test: &Test) -> Option<String> {
151151
..
152152
} = test;
153153

154-
let compile_result =FancyRegex::new(pattern);
154+
let compile_result =RegexBuilder::new(pattern).multi_line(true).build();
155155
letOk(regex) = compile_resultelse{
156156
let error =format!("{:?}", compile_result.unwrap_err());
157157
returnSome(format!("Compile failed: {}", error));
@@ -181,7 +181,6 @@ fn run_test(test: &Test) -> Option<String> {
181181
}
182182
}
183183
Assertion::NoMatch =>{
184-
let regex =FancyRegex::new(pattern).unwrap();
185184
let result = regex.find(&text).unwrap();
186185
if result.is_some(){
187186
Some("Match found".to_string())

‎tests/oniguruma/test_utf8_ignore.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
// x3 tests have an additional argument which is the group number to check.
55

66

7-
// No match found
8-
x2("^a","\na",1,2);
9-
10-
// No match found
11-
x2("$\\O","bb\n",2,3);
12-
137
// Compile failed: ParseError(0, InvalidEscape("\\c"))
148
x2("\\ca","\001",0,1);
159

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp