在React-Native中使用正则表达式时出错-无效的正则表达式:无效的组说明符名称

时间:2020-10-30 16:32:39

标签: javascript react-native

我需要从<!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Calendar</title> <link rel="stylesheet" href="calendar.css"> <script type="text/javascript" src="calendar.js" async></script> </head> <body> <div class="c_container"> <div class="c_November" > <h2 id="c_title">November 2020</h2> </div> <table id="c_calendar" > <tr> <th class="c_weekdays c_th">Week</th> <th class="c_weekdays c_th">Mon</th> <th class="c_weekdays c_th">Tue</th> <th class="c_weekdays c_th">Wed</th> <th class="c_weekdays c_th">Thu</th> <th class="c_weekdays c_th">Fri</th> <th class="c_weekdays c_th">Sat</th> <th class="c_weekdays c_th">Sun</th> </tr> <tr> <td class="c_week " >44</td> <td class="c_graydays c_td" >26</td> <td class="c_graydays c_td" >27</td> <td class="c_graydays c_td" >28</td> <td class="c_graydays c_td" >29</td> <td class="c_graydays c_td" >30</td> <td class="c_graydays c_weekend c_td" >31</td> <td class="c_weekend c_td">1</td> </tr> <tr> <td class="c_week " >45</td> <td class="c_td">2</td> <td class="c_td">3</td> <td class="c_td">4</td> <td class="c_td">5</td> <td class="c_td">6</td> <td class="c_weekend c_td">7</td> <td class="c_weekend c_td">8</td> </tr> <tr> <td class="c_week ">46</td> <td class="c_td">9</td> <td class="c_td">10</td> <td class="c_td">11</td> <td class="c_td">12</td> <td class="c_td">13</td> <td class="c_weekend c_td">14</td> <td class="c_weekend c_td">15</td> </tr> <tr> <td class="c_week" >47</td> <td class="c_td">16</td> <td class="c_td">17</td> <td class="c_td">18</td> <td class="c_expedition c_td">19 <span class="c_expeditiontext"> Thursday the 19th of November all pupils will have an expedition to damlia, our local dam. There we will learn more about insects and other wildlife near the dam. The trip will be from 08:00 to 15:00. Meet at the main entrance 07.45 and remember to pack a lunch!</span> </td> <td class="c_td">20</td> <td class="c_weekend c_td">21</td> <td class="c_weekend c_td">22</td> </tr> <tr> <td class="c_week ">48</td> <td class="c_talent c_td">23 <span class="c_talenttext"> 23rd of november is the time for the biyearly talentshow! The show will take place in auditorium A1 at 18.00 til 21.00.</span> </td> <td class="cr_talent c_td">24 <span class="cr_talenttext"> This is a rerun of yesterdays talentshow, except this time parents are welcome as well! (at auditorium A1 18.00 - 21:00)</span> </td> <td class="c_td">25</td> <td class="c_td">26</td> <td class="c_td">27</td> <td class="c_weekend c_td" >28</td> <td class="c_weekend c_td">29</td> </tr> <tr> <td class="c_week ">49</td> <td class="c_td">30</td> <td class="c_graydays c_td" >1</td> <td class="c_graydays c_td" >2</td> <td class="c_graydays c_td" >3</td> <td class="c_graydays c_td" >4</td> <td class="c_graydays c_weekend c_td" >5</td> <td class="c_graydays c_weekend c_td" >6</td> </tr> </table> </div> </body> </html>到最后<img>的所有src=标记内获取所有字符串,例如:

"

我需要获取:<img src="file:///data/user/0/com.app/cache/ImagePicker/2b807bcc-f622-4019-abf1-6875c1130a09.jpg"></div><br><div>

为此我使用以下正则表达式:"file:///data/user/0/com.app/cache/ImagePicker/2b807bcc-f622-4019-abf1-6875c1130a09.jpg"

但这给了我这个错误:

enter image description here

但可以在在线编辑器中对其进行测试:

enter image description here

我该如何解决?,谢谢:)

0 个答案:

没有答案