仅从数字文件中获取最后4位数字。
$ cat test
12298700077
56198700770
23192604888
34198701041
89198701285
$ cat test | grep 0077
12298700077
56198700770
所需的输出就是这个
12298700077
答案 0 :(得分:0)
使用正则表达式,特别是(<div class="card-body">
<table class="table">
<thead>
<tr>
<th>Photo</th>
<th>Name</th>
<th>Email</th>
<th>Rating</th>
<th >delete</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let user of users | async">
<td >
{{user.photoUrl}}
</td>
<td>
{{user.userName}}
</td>
<td >
{{user.email}}
</td>
<td>
{{user.rating}}// Want this user rating as number into star rating
</td>
<td>
{{user.id}}
</td>
<td>
<button class="btn btn-sm btn-danger"
(click)="onDelete(user.id)">delete</button>
</td>
</tr>
</tbody>
</table>
</div>
):&#39; $&#39; (匹配行尾的空字符串):
man 7 regex