I have to create a regular expression for some path conversion.
Example for path are
//name:value /name:value // name:value
/name:value /name:value
/name:value//name:value
thing is how to check for // or / at the start or middle of the string and how can i specify that name can contain any of this a-zA-Z and _
Path also contains white spaces.
This should help:
Some notes:
/or//can delineatename:valuepairs;/or//and aftername:valueis ignored;nameandvalueare captured. You don’t say what you want to capture. Adjust the parentheses as necessary;nameandvalueconsist of A-Z, a-z, 0-9 or _ (that’s what\wmeans).If you don’t want to find the values but simply test for the validity as a whole: