Want allow only lower case or "_" using sfValidatorRegex in symfony - symfony-1.4

I want to allow only lower case charecters or "_" character for text box using sfValidatorRegex of Symfony 1.4.
I had used different types of patterns like /^[a-z_]+$/i but they didn't work for me.
So if anyone can know, please help me out.

Correct Pattern is '/^[a-z_]+$/'

Related

JMAIL: Multiple Recipient

Does JMail accepts delimiter(;) or comma(,) as a separator between different email address like CDO.Message.
For example, we can write,
Mail.To="a#a.com,b#b.com" in CDO.Message.
Does the same is valid for JMAIL like the one below.
jMail.AddRecipient ("a#a.com,b#b.com")
I know we can add multiple recipients by calling the AddRecipient again and again but my question is can we do it in a single line like in CDO.Message?
yes you can add multiple recipients by calling the AddRecipient
Yes, you can.
I spent some time figuring this out as well. I tried the recommended array() of recipients but that did not seem to work. The only thing which worked for me so far was a properly formatted multiple recipient string:
$jmail->addRecipient('recipient1#site.com','recipient2#site.com','recipient3#site.com');
Please note the ["] markup. If you replace the ["] with ['] it will not work. It's little "delicate" this way :)
I am using jMail with PHP/COM extension but I am sure you can reuse this principle for ASP or any other language.
I hope this helped.

Qt Creator setInputMethodHints not work

my main goal right now is to forbid some chars entering in line edit.I want to forbid (!##$%^&*()) chars, cause i do use SQL Database and someone can damage my database without filters for this chars.I tried to use setInputMask but in this way i can use only alphabets.I need to use '-' sign too for some names like "Anna-Maria".
So finally, setInputMethodHints is not working and i don't know what to do.
I just need to forbid some "dangerous" chars.
If you can, please provide me some source code.
Thank you in advance.
Use QRegExpValidator to allow only a-z A-Z 0-9 and '-' character. If you want to add more character just put \charactor in to the rx(".."); like I did with '-' by adding \-
QRegExp rx("[a-zA-Z0-9\-]*");
ui.lineEdit->setValidator(new QRegExpValidator(rx,ui.textEdit));

Asp.net validation expression for a string

I want to create a regular expression for subdomain like:
In the textbox user need to enter like
abc1.test.com
or
abc1s.test.com
Note: .test.com is always required at the end.
The variable part can contain any letter, alphabets etc
I dont know anything about regex so i ask this silly question. I googled it for more than 2 hours but dont find any good example.
Please note this is not a homework.
Any help is highly appreciated.
There are a number of useful resources on regex online, including:
http://regexpal.com/ - test out your regex
http://www.regular-expressions.info/reference.html - regex reference
http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ - useful cheat sheet
I am sure other members will have better resources but these have sufficed for me in the past.
The following regex should work for you:
^((.+)(.test.com){1})$
the '.' is any character except new line
the '+' is one or more times
the '{1}' is exactly once
^[\d\w]+\.test\.com$ will work for your case.

Base search/find functionality (Ctrl+F) in AX 2009/2012 doesn't work properly...how to fix?

I feel like I might be losing my mind...but if you search the AOT for anything with double colons "::", it fails completely. I'm trying to step through the Forms\SysAotFind to figure this out but I didn't want to spin my wheels a bunch for something that might be on my system only.
To reproduce in AX 2009, select Classes\SalesTableType, press Ctrl+F and put "CustLedgerAccounts::sumAccount" in the containing text box and click find now. You can see this is clearly located in the Classes\SalesTableType\accountCust method. I've tried searching for base enums inside objects with no luck either.
I noticed the same behavior, but escaping the colons with a backslash makes the search work correctly.
So in your case you would need to search for "CustLedgerAccounts\:\:sumAccount".
The search uses regular expressions in the syntax defined by the match function.
Colon is a special character, hence it needs to be escaped by a backslash.
For those searching for a fix, you can see where the issue is here and just tweak it if you want to allow specifically for double colons:
[c] \Classes\SysTreeNodeSearch\isNodeInRange #46
if (!match(containingText,source))
return false;

Help with a regular expression to validate a series of n email addresses seperated by semicolons

I'm using an asp.net Web Forms RegularExpressionValidator Control to validate a text field to ensure it contains a series of email addresses separated by semicolons.
What is the proper regex for this task?
I think this one will work:
^([A-Za-z0-9._%+-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}(;|$))+
Breakdown:
[A-Za-z0-9._%+-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4} : valid email (from http://www.regular-expressions.info/)
(;|$) : either semicolon or end of string
(...)+ : repeat all one or more times
Make sure you are using case-insensitive matching. Also, this pattern does not allow whitespace between emails or at the start or end of the string.
The 'proper' (aka RFC2822) regex is too complicated. Try something like (\S+#[a-zA-Z0-9-.]+(\s*;\s*|\s*\Z))+
Not perfect but should be there 90% (haven't tried it, so it might need some alteration)
Note: Not too sure about \Z it might be a Perl only thing. Try $ as well if it doesn't work.

Resources