In the current buffer, I have :

public class Test extends HttpServlet {

...

 I want to construct the following  regular expression :

(to know if yes or no, a servlet is defined in the buffer)


1) (search-forward-regexp
"\\.*public\\w*class\\.*extends\\w*\\.*HttpServlet") ; this never matches 

2) (search-forward-regexp "\\.*extends\\.*HttpServlet") ; this never matches


3) (search-forward-regexp "\\.*extends HttpServlet") ; this never matches 

4) (search-forward-regexp "\\.*HttpServlet") ; this matches  !!!


 I'd like to get (1) to work ....

 Also, I'd like that the cursor doesn't get moved and that the search would
start from the begining of the buffer

like a function :

   (exists-in-buffer "aRegexp" aBuffer) 

Reply via email to