PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/elpa/php-mode-20171204.23/php-regex.el

https://github.com/andreaja/dotemacs
Lisp | 82 lines | 52 code | 12 blank | 18 comment | 1 complexity | 6753d17520acdeef370221f878d95588 MD5 | raw file
 1;; Copyright (C) 2015  David Arroyo Menéndez
 2
 3;; Author: David Arroyo Menéndez <davidam@gnu.org>
 4;; Maintainer: David Arroyo Menéndez <davidam@gnu.org>
 5
 6;; This file is free software; you can redistribute it and/or modify
 7;; it under the terms of the GNU General Public License as published by
 8;; the Free Software Foundation; either version 3, or (at your option)
 9;; any later version.
10
11;; This file is distributed in the hope that it will be useful,
12;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14;; GNU General Public License for more details.
15
16;; You should have received a copy of the GNU General Public License
17;; along with GNU Emacs; see the file COPYING.  If not, write to
18;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
19;; Boston, MA 02110-1301 USA,
20
21;; Regular expression
22;; http://php.net/manual/en/ref.regex.php
23;; file:///usr/share/doc/php-doc/html/ref.regex.html
24
25(define-skeleton php-ereg
26  "Insert an ereg statement"
27  ""
28  '(setq regexp (skeleton-read "Regexp? "))
29  '(setq string (skeleton-read "String? "))
30  > "ereg(" regexp ", " string ");"
31)
32
33(define-skeleton php-ereg_replace
34  "Insert an eregi_replace statement"
35  ""
36  '(setq pattern (skeleton-read "Pattern? "))
37  '(setq replacement (skeleton-read "Replacement? "))
38  '(setq string (skeleton-read "String? "))
39  > "ereg_replace(" pattern ", " replacement ", " string ");"
40)
41
42(define-skeleton php-eregi
43  "Insert an eregi statement"
44  ""
45  '(setq regexp (skeleton-read "Regexp? "))
46  '(setq string (skeleton-read "String? "))
47  > "ereg(" regexp ", " string ");"
48)
49
50(define-skeleton php-eregi_replace
51  "Insert an eregi_replace statement"
52  ""
53  '(setq pattern (skeleton-read "Pattern? "))
54  '(setq replacement (skeleton-read "Replacement? "))
55  '(setq string (skeleton-read "String? "))
56  > "eregi_replace(" pattern ", " replacement ", " string ");"
57)
58
59(define-skeleton php-split
60  "Insert a split statement"
61  ""
62  '(setq pattern (skeleton-read "Pattern: "))
63  '(setq string (skeleton-read "String: "))
64  '(setq limit (skeleton-read "Limit: "))
65  > "split(" pattern ", " string ", " limit ");" \n
66)
67
68(define-skeleton php-spliti
69  "Insert a split statement"
70  ""
71  '(setq pattern (skeleton-read "Pattern: "))
72  '(setq string (skeleton-read "String: "))
73  '(setq limit (skeleton-read "Limit: "))
74  > "spliti(" pattern ", " string ", " limit ");" \n
75)
76
77(define-skeleton php-sql_regcase
78  "Insert a DEPRECATED sql_regcase statement. Creates a regular expression for a case insensitive match"
79  ""
80  '(setq string (skeleton-read "String: "))
81  > "sql_regcase(" string ");" \n
82)