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

Safe wrapper for POSIX regular expressions API (provided by libc on POSIX-compliant OSes)

License

NotificationsYou must be signed in to change notification settings

newsboat/regex-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regex-rs: safe wrapper forPOSIX regular expressions API (provided by libc on POSIX-compliant OSes)

Example usage:

use regex_rs::*;let pattern ="This( often)? repeats time and again(, and again)*\\.";let compilation_flags =CompFlags::EXTENDED;let regex =Regex::new(pattern, compilation_flags).expect("Failed to compile pattern as POSIX extended regular expression");let input ="This repeats time and again, and again, and again.";// We're only interested in the first match, i.e. the part of text// that's matched by the whole regexlet max_matches =1;let match_flags =MatchFlags::empty();let matches = regex.matches(input, max_matches, match_flags).expect("Error matching input against regex");// Found a matchassert_eq!(matches.len(),1);// Match spans from the beginning to the end of the inputassert_eq!(matches[0].start_pos,0);// `end_pos` holds one-past-the-end indexassert_eq!(matches[0].end_pos, input.len());

License

regex-rs is licensed underthe MITlicense; see the LICENSE file.

About

Safe wrapper for POSIX regular expressions API (provided by libc on POSIX-compliant OSes)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp