I need to change all:
<label for="*">
into
<label for="*" class="inline checkbox">
But it turns out all my <label for="XXXXXX">
were turned into <label for="*" class="inline checkbox">
. Yes, the *
is literally kept as a string not as a wildcard.
How come the wildcard is only effective in Find not in Replace? What should I input in the Replace string?
I'm not sure if there is a way to do this with wildcards, but you can get it done using regular expressions:
Find and Replace
dialog box, below Find Options
, check
Use:
and from the dropdown select Regular expressions
.Find What
, type: \<label for="{.*}"\>
Replace with
, type: <label for="\1"
class="inline checkbox">
Notes:
<
and >
with \
because they are special characters..*
will match any string.\1
will replace with the string found between
the {}
in the find expression.Also, if you click the arrows next to the find and replace text boxes, you will find more info about the special characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With