Sponsored Content
Top Forums Shell Programming and Scripting Match hex value in string (Perl) Post 302436647 by alister on Monday 12th of July 2010 06:15:35 PM
Old 07-12-2010
I'm not familiar with perl's unicode capabilities, but assuming that the unicode 2026 character is encoded in utf8, a non-unicode/utf-8 aware approach will have to match a sequence of three bytes: 0xE2 0x80 0xA6.

Unicode Character 'HORIZONTAL ELLIPSIS' (U+2026)

Code:
$ printf '\xe2\x80\xa6\n' | perl -lne 'print "MATCHED: $_" if /\xe2\x80\xa6/'
MATCHED: …

Regards,
Alister

Last edited by alister; 07-12-2010 at 07:22 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

converting character string to hex string

HI Hi I have a character string which contains some special characters and I need it to display as a hex string. For example, the sample i/p string: ×¥ïA Å gïÛý and the o/p should be : D7A5EF4100C5010067EFDBFD Any pointers or sample code pls. (5 Replies)
Discussion started by: axes
5 Replies

2. UNIX for Dummies Questions & Answers

hex value in a file + perl

Am not able to display the corresponding character for the hex value using the format specifier into a file Could you please help me with that >cat other a|\xc2\xbo >cat write.pl #! /opt/third-party/bin/perl open(FILE2, "< other") || die "Unable to open file other\n"; while (... (7 Replies)
Discussion started by: matrixmadhan
7 Replies

3. Shell Programming and Scripting

Perl: Better way to match string within a string

Hi, I'm trying to get one field out of many as follows: A string of multiple fields separated with "/" characters: "/ab=12/cd=34/12=ab/34=cd/ef=pick-this.one/gh=blah/ij=something/" I want to pick up the field "ef=pick-this.one" which has no regular pattern except it starts with "ef=xxxx"... (3 Replies)
Discussion started by: Juha
3 Replies

4. Shell Programming and Scripting

pattern match url in string / PERL

Am trying to remove urls from text strings in PERL. I have the following but it does not seem to work: $remarks =~ s/www\.\s+\.com//gi; In English, I want to look for www. then I want to delete the www. and everything after it until I hit a space (but not including the space). It's not... (2 Replies)
Discussion started by: mrealty
2 Replies

5. Programming

Hex string conversion?

Hello all. I need help... How can I cenvert this 42ec93df826c804ea531c56594db453d54daad4b to normal text? What convertor I have to use? Thanks. (12 Replies)
Discussion started by: escudo
12 Replies

6. Shell Programming and Scripting

Perl : how to match non-empty string that has no spaces

Hi Everyone, I am looking for neat way to grep a non-empty string that basically contains a hostname, which might be in FWDN form or without the domain, for example: hostname.internal.domainname.net The file I am parsing contains blan lines (^$) and also series of "-" which in other places... (2 Replies)
Discussion started by: togr
2 Replies

7. Shell Programming and Scripting

Convert to Hex in perl

Hi, i want to convert number 5860533159 to hexadecimal. i need to use perl. i used $foo = 5860533159; $hexval3 = sprintf("%#x", $foo); i am getting value as 0xffffffff. i need to get value as 0x15D50A3A7. when i converted using google calculator, i got the correct value, expected... (9 Replies)
Discussion started by: asak
9 Replies

8. Shell Programming and Scripting

perl regex string match issue..kindly help

i have a script in which i need to skip comments, and i am able to achieve it partially... IN text file: {**************************** {test : test...test } Script: while (<$fh>) { push ( @data, $_); } if ( $data =~ m/(^{\*+$)/ ){ } With the above match i am... (5 Replies)
Discussion started by: avskrm
5 Replies

9. Shell Programming and Scripting

String match, with perl command

cat clinvar_00-latest.vcf | perl -aF/\\t/ -lne '/CLNSRCID=(\d+)/ and print join("\t",@F,$1)' > OMIM.txt The above code finds the text CLNSRCID=, but only outputs those records in which there is a numerical value only. For example, the first match is CLNSRCID=103320.0001 in line 4 of the... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

Using sed to split hex string

Hi, I'm looking to split the following hex string into rows of four elements. I've tried the following but it doesn't seem to work. How can I tell sed to match based on a pair of number(s) and letter(s), and add a newline every 4 pairs? In addition, I need to add another newline after every... (5 Replies)
Discussion started by: sand1234
5 Replies
idna_to_unicode_44i(3)						      libidn						    idna_to_unicode_44i(3)

NAME
idna_to_unicode_44i - API function SYNOPSIS
#include <idna.h> int idna_to_unicode_44i(const uint32_t * in, size_t inlen, uint32_t * out, size_t * outlen, int flags); ARGUMENTS
const uint32_t * in input array with unicode code points. size_t inlen length of input array with unicode code points. uint32_t * out output array with unicode code points. size_t * outlen on input, maximum size of output array with unicode code points, on exit, actual size of output array with unicode code points. int flags an Idna_flags value, e.g., IDNA_ALLOW_UNASSIGNED or IDNA_USE_STD3_ASCII_RULES. DESCRIPTION
The ToUnicode operation takes a sequence of Unicode code points that make up one domain label and returns a sequence of Unicode code points. If the input sequence is a label in ACE form, then the result is an equivalent internationalized label that is not in ACE form, otherwise the original sequence is returned unaltered. ToUnicode never fails. If any step fails, then the original input sequence is returned immediately in that step. The Punycode decoder can never output more code points than it inputs, but Nameprep can, and therefore ToUnicode can. Note that the number of octets needed to represent a sequence of code points depends on the particular character encoding used. The inputs to ToUnicode are a sequence of code points, the AllowUnassigned flag, and the UseSTD3ASCIIRules flag. The output of ToUnicode is always a sequence of Unicode code points. RETURN VALUE
Returns Idna_rc error condition, but it must only be used for debugging purposes. The output buffer is always guaranteed to contain the correct data according to the specification (sans malloc induced errors). NB! This means that you normally ignore the return code from this function, as checking it means breaking the standard. REPORTING BUGS
Report bugs to <bug-libidn@gnu.org>. GNU Libidn home page: http://www.gnu.org/software/libidn/ General help using GNU software: http://www.gnu.org/gethelp/ COPYRIGHT
Copyright (C) 2002-2012 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for libidn is maintained as a Texinfo manual. If the info and libidn programs are properly installed at your site, the command info libidn should give you access to the complete manual. libidn 1.25 idna_to_unicode_44i(3)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy