I tried several ways to add line-breaks in the google groups description field while creating the group using the Google directory api. https://developers.google.com/admin-sdk/directory/v1/reference/groups/insert
Ex: \n, \r\n,

 etc.
But none of the worked.
Please let me know if you have any other option.
Thanks
The last thing you can try is to URI encode the '\n' using %0A. This seems to have been successfully used in this SO post.
Related
I've searched all the other Regex on Google Analytics questions but I can't use the answers as this is pretty specific to my problem.
I want to set a destination URL goal but use Regex to flag it as a goal IF string includes /general/
I basically want to track everyone in GA who goes to a Vehicle Detail Page but /general/ brings them to a Search Results Page.
so in other words
/used-cars/general is not correct
/used-cars/citreon/ is correct
/used-cars/TOYOTA/ is correct
Basically, any other car maker is correct after /used-cars/ regardless if it is capitalized or not.
Thanks in advance, everyone.
Your regex is on the right path, but you should escape any special characters. Try the below instead:
/used\-cars/(citreon|TOYOTA|RENAULT|VOLKSWAGEN|VAUXHALL|HONDA|BMW|NISSAN|PEUGEOT|DS|FORD|HYUNDAI|INFINITI|MERCEDES\-BENZ|MITSUBISHI)/
I'm building APIs using Laravel, and for some reason, the response generated seems to add a new line before returning the response. An example of this issue is explained in this link.
I suspect this is because there is an empty space or new line character before the opening tags in one of the PHP files. I was wondering what's the easiest way to find it? I use PHPStorm, and it has a regex search option. I am quite clueless as to how to use it to find the files though. Any ideas?
You could use \s+<\?php. To remove the spaces, replace the matches with <?php.
I am creating a google form and trying to create a regex on of the fields because I need them to enter a profile link from a specific website. I'm a beginner with regex and this is what I have come up with:
/^(http:\/\/)?(steamcommunity\.com\/id\/)*\/?$/
But when I go to enter a test link such as: http://steamcommunity.com/id/bagzli it fails it. I don't understand what is wrong about it.
You missed a dot (meaning any character) after the (/id\). Try this:
/^(http:\/\/)?(steamcommunity\.com\/id\/).*\/?$/
^-- added
The ultimate goal of what I was trying to accomplish is to ensure that certain text was entered in the box. I thought I had to use Regex to accomplish that, but google forms also has "Text Contains" feature which I made use of to solve my problem. The regex by Zoff Dino did not work, I am not sure why as it seems completely correct.
I will mark this as resolved as I managed to get my answer, even if it was not via regex.
Input:
source http://www.emaxhealth.com/1275/misdiagnosing from here http://www.cancerresearchuk.org/about-cancer/type recounting her experiences and thoughts blog http://fty720.blogspot.com even carried the new name. She was far from home.
From the about input I want to remove the hyperlinks. Below is the regex that I am trying
http://[\w|\W|\d|\s]*(?=[ ])
This regex will encompass all characters,digits and whitespaces after encountering the word 'http' and will continue till first blank space.
Unfortunately, it is not working as expected. Please do help me find out my error.Thanks
Try this sed command
sed 's/http[^ ]\+//g' FileName
Output :
source from here recounting her experiences and thoughts blog even carried the new name. She was far from home.
To find the hyperlink use:
\b(https?)://[A-Z0-9+&##/%?=~_|$!:,.;-]*[A-Z0-9+&##/%=~_|$]
or:
If you want to find the html a tag use:
<a\b[^>]*>(.*?)</a>
I wanted to use a regular expression that covers multiple lines to search in the google appengine log console. I've tried:
firstpart.*\n(.*\n)+.*secondpart
firstpart.*$(.*$)+.*secondpart
but neither of these work. Does anyone know if this is possible?
Thanks, Richard
Not sure if I'm understanding the question correctly, but to search for line breaks you should use \r\n as opposed to just \n.
\n will work when searching inside the logs but not between the top line of the log of the form
2011-06-23 10:07:24.522 /users/action?key=agl5cmVjZWlwdHNyEgsmljZRjR5YQDDA 302 ....
and the rest of the logs