Smarten regex to include overbar, superscript and subscript.
Fixes https://gitlab.com/kicad/code/kicad/issues/8730
This commit is contained in:
parent
289a35ad81
commit
f6aaaff81a
|
@ -121,4 +121,11 @@
|
|||
<td></td>
|
||||
<td> <samp> <sub> </sub> <sub> </sub> <u> </u></samp><br> <samp>MEM.D<sub>1</sub>, MEM.D<sub>2</sub>, MEM.LATCH</samp> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<i>Note that markup has precedence over bus definitions.</i>
|
||||
|
||||
|
|
|
@ -202,7 +202,8 @@ bool SCH_FIELD_VALIDATOR::Validate( wxWindow* aParent )
|
|||
}
|
||||
|
||||
|
||||
wxRegEx SCH_NETNAME_VALIDATOR::m_busGroupRegex( R"([^$]?{)", wxRE_ADVANCED );
|
||||
// Match opening curly brace, preceeded by start-of-line or by a character not including $_^~
|
||||
wxRegEx SCH_NETNAME_VALIDATOR::m_busGroupRegex( R"((^|[^$_\^~]){)", wxRE_ADVANCED );
|
||||
|
||||
|
||||
wxString SCH_NETNAME_VALIDATOR::IsValid( const wxString& str ) const
|
||||
|
@ -214,11 +215,11 @@ wxString SCH_NETNAME_VALIDATOR::IsValid( const wxString& str ) const
|
|||
if( ( str.Contains( '[' ) || str.Contains( ']' ) ) &&
|
||||
!NET_SETTINGS::ParseBusVector( str, nullptr, nullptr ) )
|
||||
{
|
||||
return _( "Signal name contains '[' or ']' but is not a valid vector bus name" );
|
||||
return _( "Signal name contains '[' or ']' but is not a valid vector bus name." );
|
||||
}
|
||||
|
||||
// Figuring out if the user "meant" to make a bus group is somewhat trickier because angle
|
||||
// brackets are also used for variable expansion
|
||||
// Figuring out if the user "meant" to make a bus group is somewhat trickier because curly
|
||||
// braces are also used for formatting and variable expansion
|
||||
|
||||
if( m_busGroupRegex.Matches( str ) && str.Contains( '}' ) &&
|
||||
!NET_SETTINGS::ParseBusGroup( str, nullptr, nullptr ) )
|
||||
|
|
Loading…
Reference in New Issue