Sponsored Content
Full Discussion: Regex help needed
Top Forums Shell Programming and Scripting Regex help needed Post 302609145 by Shell_Life on Monday 19th of March 2012 10:54:03 AM
Old 03-19-2012
See if the ^ (caret) works for you:
Code:
/au/äu/
/a[^u]/ä/
/o/ö/
/[^a]u/ü/

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed and regex help needed

Hi all, I'm writing a script that replaces a value in a file. The file is formatted as follows: So, for this example, I'd like to replace the value for param_two. The value for param_two can be a one, or two-digit number. It replaces the value in file.cfg, and directs the... (9 Replies)
Discussion started by: marknu1
9 Replies

2. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

3. Shell Programming and Scripting

regex in ls

Hi Experts, I am using ls with regex in the below manner: VAR="*.txt *.TXT" ls -l $VAR This is working fine if I have both txt and TXT extension files in my directory. But if any of them is not present, its throwing errors, that *.TXT file not found in the directory. So what am i missing... (6 Replies)
Discussion started by: sugarcane
6 Replies

4. Shell Programming and Scripting

perl regex help needed

Hi, I want to validate strings in perl, the string may contains characters from a-zA-Z0-9 and symbols +-_.:/\ To validate such a string I computed a regex if ($string =~ m/^/) { print "valid"; } else { print "invalid"; } but this regex also validates strings that contain... (8 Replies)
Discussion started by: zing_foru
8 Replies

5. UNIX for Dummies Questions & Answers

read regex from ID file, print regex and line below from source file

I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header. In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

6. Shell Programming and Scripting

Help needed in regex

Hi, Could you please help me in writing a regex for the following requirement? Let following be the string format: abc.cdef.ghij.lm I need to check between dots, there is atleast one character{a-z,A-Z,*}. Eg: abc1.gt2.345j is valid, but not 123.abc.vff.gth because 123 should not be... (2 Replies)
Discussion started by: lorzinian
2 Replies

7. UNIX for Dummies Questions & Answers

Regex Needed:(

I am looking for the proper regex to match the hostname "areagc11" of this log.... Any help would be awsome:) Oct 25 11:08:18 areagc11 961: Oct 25 18:08:17.536 GMT: %SYS-5-CONFIG_I: Configured from console by someone onvty1 (10.156.72.97) (6 Replies)
Discussion started by: jlaigo2
6 Replies

8. UNIX for Dummies Questions & Answers

RegEX help needed

Hi, Have to filter out string before the last underscore in the following input: UNIX_Solaris_59_KSH output: UNIX_Solaris_59 dummy one but :mad: Thanks & Regards, Sourabh Singh Khichi (4 Replies)
Discussion started by: skhichi
4 Replies

9. Shell Programming and Scripting

Perl, RegEx - Help me to understand the regex!

I am not a big expert in regex and have just little understanding of that language. Could you help me to understand the regular Perl expression: ^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{ ------ This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies

10. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
HTML::FormHandler::Manual::FromFF(3pm)			User Contributed Perl Documentation		    HTML::FormHandler::Manual::FromFF(3pm)

NAME
HTML::FormHandler::Manual::FromFF - converting from HTML::FormFu VERSION
version 0.40013 SYNOPSIS
Manual Index Cheatsheet for converting from HTML::FormFu. DESCRIPTION
Information that may be useful when converting to FormHandler from FormFu. Inside/Outside FormFu forms look to me like "inside-out" objects. The attributes and code are all set outside of the object. FormHandler forms are the opposite. Almost all attributes and settings are set *inside* the form class, although settings can be passed in on 'new' and 'process', of course. FormHandler fields are built as part of the object construction process, so you do not create or add new fields after the form instance has been constructed. There are many facilities for setting fields active/inactive or changing the various field attributes, so this is not limiting in what you can do. One of the big advantages of having form fields and validations, etc, inside the object is that it makes it a lot easier to test exactly what you're using in your controllers. Config files There are so many drawbacks to using config files to specify your forms that I don't see why anybody would voluntarily do it. However it takes all kinds, so if you really want to use config files, you can...mostly. There are a lot of things you can't do in config files, but FormHandler provides so many ways of doing things, that you can probably get it to work. And sometimes it's easier to update forms piecemeal, or there may be policies in place, so if you really want/need config files for building forms, see HTML::FormHandler::Foo and the test in t/form_setup/config.t. Rendering You should be able to make your FormHandler forms automatically render very close to FormFu's rendering. There's an example of simple FormFu-like rendering in t/render/ff.t. Set up a base class with the necessary code, and your forms could be practically drop-in replacements from a rendering perspective. Filters, Constraints, Inflators, Validators, Transformers FormHandler doesn't distinguish between these categories in the same way that FormFu does. FormHandler has inflation/deflation, validation methods, and apply actions. The distinguishing factor is mostly where it happens in the process. Filters A 'trim' filter is installed by default in FormHandler; it's a special version of an apply action, and can be set to a transform or Moose type. See the documentation in HTML::FormHandler::Field#trim. An HTML filter is applied by default in certain places in the rendering. You can change it with the 'render_filter' attribute. See HTML::FormHandler::Manual::Rendering#Rendering-filter. You can change the form of the field's value using a number of inflation/deflation methods, or a transform, or a Moose type. See HTML::FormHandler::Manual::InflationDeflation and HTML::FormHandler::Manual::Validation. Transforms and inflations/deflations do not change what is presented in the form unless you set the 'fif_from_value' flag on the field (the rough equivalent of FormFu's 'render_processed_value'). FormatNumber Use an inflation: has_field 'foo' => ( type => 'PosInteger', inflate_method => &format_number ); sub format_number { my ( $self, $value ) = @_; return unformat_number( $value ); } Constraints A lot of these are simple regexes or functions. If they're things you're going to use often, you probably want to put them in a type library or validator class. AllOrNone Not implemented. Do this in a form 'validate' sub. ASCII A simple regex: has foo => ( apply => [ { check => qr/^p{IsASCII}*z/, message => 'Not a valid string' } ] ); AutoSet Not necessary. This is done automatically by FormHandler. You'd have to go to some work to avoid it. Bool A simple regex: qr/^[01]?z/ Or you can use the Boolean field. Callback, CallbackOnce This is just validation done in code. Use one of the many places you can put validation in methods in FormHandler. See HTML::FormHandler::Manual::Validation. DateTime Use Date or DateTime field or make your own. DependOn Use 'dependency' attribute in the form. Or do more complicated things in the form's 'validate' sub. Email Use the 'Email' field type, or use the the FH Moose Type, 'email'. has_field 'email' => ( type => 'Email' ); -- or -- use HTML::FormHandler::Types ('Email'); has_field 'email' => ( apply => [ Email ] ); Equal No equivalent. Perform this check in the form's 'validate' sub. File Use 'Upload' field. Integer Use 'Integer' field. Length, MaxLength, MinLength Use 'minlength' and 'maxlength' on the Text field and its subclasses. Range, MaxRange, MinRange Use 'range_start' and 'range_end'. MinMaxFields No equivalent. Number Use Moose type 'Num'. Printable Use FormHandler Moose type 'Printable'. reCAPTCHA Use Captcha field or HTML::FormHandlerX::Field::reCAPTCHA. Regex Use 'check' action with regex. Required Set 'required' flag on the field. Set Use 'check' action with arrayref of strings. SingleValue Not necessary. Word This is a simple regex: qr/^w*z/ Substitute FormHandler Moose type 'SingleWord'. Inflators Use one of the inflation/deflation methods. See HTML::FormHandler::Manual::InflationDeflation. Validators See HTML::FormHandler::Manual::Validation. Transformers See HTML::FormHandler::Manual::InflationDeflation and HTML::FormHandler::Manual::Validation. AUTHOR
FormHandler Contributors - see HTML::FormHandler COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Gerda Shank. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-25 HTML::FormHandler::Manual::FromFF(3pm)
All times are GMT -4. The time now is 07:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy