I have a bunch of XML that has lines that look like this
<_char font_name='/ITC Stone Serif Std Bold' italic='true' />
but sometimes look like this
<_char font_size='88175' italic='true' font_name='/ITC Stone Serif Std Bold' />
Here’s what I need to do
- Replace italic=’true’ with italic=’false for every line that contains ITC Stone Serif Std Bold, regardless of whether it comes before OR after the italic part.
Can this be done with a single regex?
I’m not looking for a real-time solution. I just have a ton of XML files that have this ‘mistake’ in them and I’m trying to do a global search-and-replace with PowerGrep which would require a single regex. If scripting’s the only way to do it, then so be it.
Does the simple use of ‘|’ operator satisfy you ?
That should detect any line with the attribute name before of after attribute italic with value true.