regsub and regexp

 

 

 

 (use the exp to match the string, it it matches, put it to sting), if it matches, it returns 1, if not matches, it returns 0.

 

 

options:
  -indices: return the start and endpoint index of the matching string.

 

   -expanded: ignore the whitespace and comments.

  -nocase:

 

 -all:

 

 by default, it will find the last space where it finds, but here it matches all.

-inline:

 

 

 

 

 

 

regexp h h1 exp

>>it returns 1; the value of exp is now: h.

regexp {^[0-9]+$} 510

=>1

regexp {^[0-9]+$} -510

=>0

 

 

 

Regsub

 

posted @ 2020-11-14 14:05  John_K  阅读(174)  评论(0)    收藏  举报