Changed regexp-substring so that unmatched submatches return #f instead of
raising an error.
This commit is contained in:
		
							parent
							
								
									5e85d401b9
								
							
						
					
					
						commit
						0e28399b12
					
				|  | @ -26,12 +26,9 @@ | |||
| (define (match:substring match . maybe-index) | ||||
|   (let* ((i (:optional maybe-index 0)) | ||||
| 	 (start (vector-ref (regexp-match:start match) i))) | ||||
|     (if start | ||||
| 	(substring (regexp-match:string match) | ||||
| 		   start | ||||
| 		   (vector-ref (regexp-match:end match) i)) | ||||
| 	(error match:substring "No sub-match found." match i)))) | ||||
| 
 | ||||
|     (and start (substring (regexp-match:string match) | ||||
| 			  start | ||||
| 			  (vector-ref (regexp-match:end match) i))))) | ||||
| 
 | ||||
| ;;; Compiling regexps | ||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 shivers
						shivers