答案 0 :(得分:3)
输入:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rootLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white"
android:gravity="top">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's name:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/placeholder_text"
android:id="@+id/patientsNameTextView"
android:gravity="right"
style="@style/blueBodyText"
/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's gender:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/placeholder_text"
android:id="@+id/patientsGenderTextView"
android:gravity="right"
style="@style/blueBodyText"
/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's DOB:"
style="@style/bodyText"
android:id="@+id/patientsDOBTitle"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/placeholder_text"
android:id="@+id/patientsDOBTextView"
android:gravity="right"
style="@style/blueBodyText"
/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's telephone:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/patientsTelephoneTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
style="@style/horizontalLinearLayout"
android:background="@android:color/white"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:gravity="top">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's postcode:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/patientsPostcodeTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's address:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/patientsAddressTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Reason for referral:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/referralReasonTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white"
style="@style/verticalLinearLayout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient presenting with:"
style="@style/bodyText"
android:layout_marginBottom="@dimen/very_small_vertical_spacing"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/additionalInfoTextView"
style="@style/blueBodyText"
android:text="@string/placeholder_text"
android:gravity="left"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Details of allergies:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/allergiesTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Registered surgery:"
style="@style/bodyText"
android:id="@+id/registeredTextTitle"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/surgeryTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingBottom="@dimen/small_vertical_spacing"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@color/grey_light_expanded"
android:paddingTop="@dimen/small_vertical_spacing"
android:id="@+id/patientsBookingLocationHolder">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/patientsBookingLocationTextView"
android:gravity="left"
style="@style/boldBlueBodyText"
android:text="@string/placeholder_text"
/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"
android:id="@+id/patientsBookingLocationHolderHR"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@color/grey_light_expanded">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Contact number:\n(at time of booking)"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/contactNumberTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@color/grey_light_expanded"
android:id="@+id/patientRepHolder">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's representative:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/representativeTextView"
android:gravity="right"
style="@style/blueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:layout_margin="0dp"
android:id="@+id/patientRepHolderHR"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:id="@+id/ambulanceRequiredHolder"
android:background="@color/grey_light_expanded">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Ambulance required:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:id="@+id/ambulanceRequiredTextView"
android:gravity="right"
style="@style/boldBlueBodyText"
android:text="@string/placeholder_text"/>
</LinearLayout>
<View style="@style/hr"
android:id="@+id/ambulanceRequiredHolderHR"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:id="@+id/patientsLocationHolder"
android:background="@color/grey_light_expanded">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's location at time of booking:"
style="@style/bodyText"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Patient's name:"
android:id="@+id/patientsLocationTextView"
style="@style/blueBodyText"
android:layout_marginTop="@dimen/small_vertical_spacing"/>
</LinearLayout>
<View style="@style/hr"
android:id="@+id/patientsLocationHolderHR"
android:layout_margin="0dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="top"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="I confirm that:"
style="@style/bodyText"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text=""
android:layout_marginTop="@dimen/small_vertical_spacing"
android:gravity="left"
style="@style/bodyText"
android:textSize="12sp"
android:id="@+id/confirmationText"/>
</LinearLayout>
</LinearLayout>
以正则表达式模式查找和替换:
找到:http://img6a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-400x400-imadfebcbg7yzrmh.jpeg,http://img5a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-75x75-imadfebcbg7yzrmh.jpeg
替换为:^(.*?jpeg).*$
结果:
\1
说明:
http://img6a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-400x400-imadfebcbg7yzrmh.jpeg
答案 1 :(得分:2)
以下是我要做的事情,使用macro:
你有一千行格式
http://www.alice.com/bob.jpeg;http://www.wolf.com/rabbit.jpeg
你想变成
http://www.alice.com/bob.jpeg
删除&#34; .jpeg&#34;。
的第一个实例后的所有内容Macro -> Start recording
菜单项。Find
对话框。.jpeg
的下一个实例。.jpeg
。.jpeg
。Macro -> Stop recording
菜单项。此时,宏已设置,应该可以使用。
转到Macro -> Playback
菜单项以在下一行测试它。
如果它按预期工作,请尝试Macro -> Run a macro multiple times
菜单项并尝试运行几次(小心开始,比如五次)。
如果在这一点上,结果如您所愿,那么你就行了!在Run a macro multiple times
菜单项中输入一个较大的数字以接近文件末尾,然后使用Playback
项(或按 Ctrl + Shift + P )进行操作最后几个。