Skip to content

URLs component-based input and output Patterns. Matching URLs against Regular Expressions is straight forward, however outputting those URLs given a certain pattern is not. Pattern is a Python module to match URL strings against INPUT PATTERNS and output new URL strings based on OUTPUT PATTERN. Examples:

Notifications You must be signed in to change notification settings

nwohaibi/URLPatterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

URLPatterns

URLs component-based input and output Patterns in the Python language.
Matching URLs against Regular Expressions is straight forward, however outputting those URLs given a certain pattern is not.
Pattern is a Python module to match URL strings against INPUT PATTERNS and output new URL strings based on OUTPUT PATTERN.
This library was made for filtering adult content in private networks.

Syntax:

  • New feature syntax: <re:regex:end>, regex: can take any regular expression syntax.

Examples:

URL syntax: <scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]

Input pattern: <*>://youtube.com/<*>/watch?<*>v=<*>#<*>
Testing URL: http://www.youtube.com/watch?v=xyz
Match Result: True
Output pattern: <s>://youtube.com/<q=v:name>/<q=v:value>
Result URLs: http://youtube.com/v/xyz

Input pattern: <*>://twitter.com/<*>#!/<*>
Testing URL: http://twitter.com/#!/xyz
Match Result: True
Output pattern: <s>://twitter.com/users/show_for_profile.json?screen_name=<f:[2,]>
Output pattern: <s>://twitter.com/users/<f>
Result URLs: http://twitter.com/users/show_for_profile.json?screen_name=xyz
Result URLs: http://twitter.com/users/!/xyz

About

URLs component-based input and output Patterns. Matching URLs against Regular Expressions is straight forward, however outputting those URLs given a certain pattern is not. Pattern is a Python module to match URL strings against INPUT PATTERNS and output new URL strings based on OUTPUT PATTERN. Examples:

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published