Based to this Topic: How do I replace a line in a file using PowerShell?
<setting name="Media.MediaLinkServerUrl" value=" "/>
The Regex to select whatever inside: value=" and "/> is
$regex = '(?<=<setting name="Media\.MediaLinkServerUrl" value=")[^"]*'
It work well!
but what about if:
<setting name="Media.MediaLinkServerUrl" value=" \/>
I tried:
$regex = '(?<=<setting name="Media\.MediaLinkServerUrl" value=")[^\]*'
and
$regex = '(?<=<setting name="Media\.MediaLinkServerUrl" value=")[^\\]*'
but it doesn't work!
I know \ is an reserved regex character, but [^.]* or [^|]* for example work well.
So how to select between \ and \ with Regex in Powershell in the example above?
A Big thx!
Ps: I can't comment or ask on the original post because i don't have 50 reputation, sorry.
lang-bash
 
 
 
[^\\]*example does work and will match the space between"and\. aside from that, its not clear what the intent isvalue="isn't a valid attribute, because a closing"is missing.