回答編集履歴

2

sample

2018/07/26 00:48

投稿

yambejp
yambejp

スコア114839

test CHANGED
@@ -9,3 +9,45 @@
9
9
  <meta http-equiv="refresh" content="0;URL=./b">
10
10
 
11
11
  ```
12
+
13
+
14
+
15
+ # sample
16
+
17
+
18
+
19
+ ちょっと埒が明かない感じなのでsampleつけます
20
+
21
+ ```javascript
22
+
23
+ $(function(){
24
+
25
+ $('a').filter(function(){
26
+
27
+ return $(this).attr('href').match(/^http://.*?/a/[^/]+?/$/);
28
+
29
+ }).attr('href',function(){return $(this).attr('href')+"b/"});
30
+
31
+ });
32
+
33
+ ```
34
+
35
+ ```HTML
36
+
37
+ <a href="http://example.com/a/xxx/">対象</a><br>
38
+
39
+ <a href="http://example.com/a/xxxgsdferggafrssfa/">対象</a><br>
40
+
41
+ <a href="http://example.com/a/yyy/">対象</a><br>
42
+
43
+ <hr>
44
+
45
+ <a href="http://example.com/a/">非対象</a><br>
46
+
47
+ <a href="http://example.com/a/xxx/yyy/">非対象</a><br>
48
+
49
+ <a href="http://example.com/x/xxx/">非対象</a><br>
50
+
51
+ ```
52
+
53
+ もう少し何が対象で何が非対象なのかを例示しないと細かいマッチングができません

1

調整

2018/07/26 00:48

投稿

yambejp
yambejp

スコア114839

test CHANGED
File without changes