blob: 2fb0f93f2cf2679d731ef4178f2070f7e0b28535 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/**
* Search
*/
export type TextElementSearch = {
type: 'search'
content: string
query: string
};
export default function(text: string) {
const match = text.match(/^(.+?)( | )(検索|\[検索\]|Search|\[Search\])(\n|$)/i);
if (!match) return null;
return {
type: 'search',
content: match[0],
query: match[1]
};
}
|