Open mywebmanavgat opened 2 weeks ago
@mywebmanavgat Suppose you need something like
<\s*([a-zA-Z]+)|\s+([a-zA-Z]+)(?=\s*=\s*"[^"]*")
- select everything in all tags<\s*(form|button)(?:\s+([a-zA-Z]+)(?=\s*=\s*"[^"]*"))*
- select everyting inside form or button tags<\s*(form|button)\b|(?<=\s)(class)\b(?=\s*=\s*"[^"]*")
- selects only class in form or button.You can adopt above regexps to your needs. Also I recommend you to use ChatGPT to generate regexps and https://regex101.com/ to test/validate it.
I tried the regexes you sent on the regex test site. However,
It applies in the attriibutes of all elements such as div, i, img until the
@mywebmanavgat Can you share your email? I can send a promocode for 1 more free month.
I sent an e-mail to the e-mail address in your profile. Thank you for your attention.
I try but it fails because there is no and operator in the regex.
(?=\s+(\w+(-\w+(-\w+)?)\s*=) this regex code selects all attribute keys and works very well.
To select those starting with <form
form\s+(\w+(-\w+)?)\s*=
but this selects the first attribute and not the rest.
but I need two steps to apply it for lines starting with
@mywebmanavgat Wow, you did a lot of work.
As for plugin functionality - regexp functionality was created for that, as implementation would be too specific for particaular.
I also asked chatgpt to combine regexps for you and he suggested:
(<form|<input|<select|<textarea|<option|<label|<button).* (data-[^=]*|id|class|method|action|type|value|for|name|placeholder|min|max|selected|rows|readonly|disabled)=|(<\/form>|<\/textarea>|<\/select>|<\/option>|<\/button>|<\/label>|<label>|<button>)
(<table|<thead|<tbody|<tfoot|<tr|<td|<th).* (id|class|scope|colspan|data-[^=]*)=|(<\/table>|<\/thead>|<\/tbody>|<\/tfoot>|<\/tr>|<\/td>|<\/th>|<th>|<table>|<thead>|<tbody>|<tfoot>|<tr>|<td>)
(<a).* (class|href|title|id|data-[^=]*)=|(<a>|<\/a>)
@clutcher
the code you pass only captures one attribute and leaves it. for this you need to run the regex algorithm twice. but better highlight does not support this.
https://regex101.com/r/kQEu0M/1
If there is only one class in an element, it catches it. but if there is both a class and a name in an element, it catches the last one and leaves it.
Hello, how can I make the following colouring?
I need a regex that selects and colours the attiributes keys between starting with
<form and ending with >
u can see example https://intellij-support.jetbrains.com/hc/user_images/01J0Y6K5RRWJQTWFWMD2BYDE0R.jpegI want to do this by creating regex rules in this way