# PetscOptionsValidKey
PETSc Options database keys must begin with one or two dashes (-) followed by a letter. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscOptionsValidKey(const char key[], PetscBool *valid)
```
Not collective


## Input Parameter

- ***key -*** string to check if valid



## Output Parameter

- ***valid -*** `PETSC_TRUE` if a valid key




## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/options.c.html#PetscOptionsValidKey">src/sys/objects/options.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/options.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
