Question: I'm developing an app using Apache Cordova for Visual Studio. The purpose of this app is to take a picture using the phone and upload this picture alongside with some other user input data to our company's webpage, that uses a SQL-server Database to store it's data. 

So, the question is: How can I insert data to this database so I can show it on the webpage, considering that the app will be used outside of our network? So it can't be a local connection to our database!

Answer: 
### `grep` pattern containing newline ([bash](/questions/tagged/bash "show questions tagged 'bash'"): `$'\n'`)

Try this:

```
grep -Pz '\AThis.*\n<\?xml.*\?>' test.txt

```

, this

```
grep -Pz '<\?xml.*\?>' test.txt

```

, this

```
grep -Pz '^<\?xml.*\?>' test.txt 

```

and this

```
grep -Pz '\A<\?xml.*\?>' test.txt 

```

or this

```
grep -z $'^This.*\n<\\?xml.*\\?>' test.txt 

```
You can join the lines to a big line by `xargs` before applying the regex:

```
# no match returns
cat test.txt | xargs | grep '^<?xml.*?>'

```

[Check for more usage on `xargs`](http://tecadmin.net/xargs-command-in-linux-with-example/#)