python - Cleaner regex for removing characters before dot or slash -


is there cleaner regex following? know can search 2 different regex @ same time combining them |.

i'm removing before first occurrence of . or - following regex , space after these.

re.sub("^[^-]*- |^[^.]*. ", "", string) 

re.sub(r"^[^.-]*[.-]\s*","",some_string) 

you can try this.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -