Question: I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:

```
<div class="row"> 
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-6 control-label pull right">Password: </label>
                    <div class="col-md-6">
                        <input type="text" name="Password" class='form-control'  />
                    </div>
                </div>
            </div>
    </div>

```

Answer: 
I assume that you'd like to extract the first of two numbers in each string.

You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:

```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1"  NA  

```
With `str_extract` from `stringr`:

```
library(stringr)

vec = c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27", 
        "Pic 29 + 30", "Pic 30 + 29", "Pic 31 + 32")

str_extract(v1, "[0-9]+")
# [1] "26" "27" "28" "29" "30" "31"

```