File: test.in

package info (click to toggle)
filepp 1.7.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,120 kB
  • ctags: 240
  • sloc: perl: 2,597; makefile: 489; sh: 174; ansic: 15
file content (54 lines) | stat: -rw-r--r-- 1,191 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Tests for regexp module:

#regexp /\s//
Get rid of all whitespace on a line 
including newline
#regexp /$/__NEWLINE__/
Get rid of all whitespace on a line but keep newline
#regexp /g/G/
Change all lowercase g's to uppercase and remove whitespace
#rmregexp /\s//
#rmregexp /$/__NEWLINE__/
#rmregexp /g/G/
#regexp /\s{2,}/ /
Change     all    multiple    whitespace   to single    whitespace
#rmregexp /\s{2,}/ /
#regexp /^\s+//
   Remove all whitespace from start of line  
#regexp /\s+$/__NEWLINE__/
   Remove all whitespace from end of line   
#define MACRO test
   MACRO   
#regexp /inside/MACRO/
Test of macros inside regexps
#define MACARGS(ARG) "Macro with ARG"
#regexp /MACARGS(foo)/bar/
"Macro with foo" MACARGS(foo)

Reminder - regexps also work with normal #if keyword (regexp module not needed)
#if ("MACRO" =~ /\d/)
 WRONG
#endif
#define MACRO 123
#if ("MACRO" =~ /\d/)
 RIGHT
#endif

#regexp /\/\/\s+(keyword|test|result)/In comment: <$1>/

// keyword and other stuff
// no change
// test

// result

#regexp /\s\/a/b/
#regexp /\s\/a/b/
this is a testa
this is a test /a
#rmregexp /\s\/a/b/
this is a testa
this is a test /a
#rmregexp /\s\/a/b/
this is a testa
this is a test /a