How to exclude a match from changes if it has some character before matched pattern?
I'm trying to match all occurences with (\"[A-Z][A-Z][A-Z]\")
but exclude them if they have "equal" sign before like this ([^\=]\"[A-Z][A-Z][A-Z]\")
. How can I do that in Android studio, Notepad++ Python Script or other tools?
"ZAR""""""I""""""""""EUR""""""""AED""AFN""ALL""AMD""ANG""AOA""ARS""AUD""AWG"
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="70dp"
android:layout_marginRight="70dp"
android:layout_weight="1"
android:text="AED" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="70dp"
android:layout_marginRight="70dp"
android:layout_weight="1"
android:text="AFN" />
I want to exclude android:text="AFN (or other letters)"
With Notepad++, based on the provided example, you can try:
- Find what:
(?<!\=)"[A-Z][A-Z][A-Z]"
- Search mode: Regular expression
Use negative lookbehind (?<!\=)
to find 3 capital letters items with quotes before and after "[A-Z][A-Z][A-Z]"
, but not when there is an =
before them.