JSonDataAccess HowTo strip certain characters

I always fight if you use regular expressions ;-)

Maybe someone can give me a hint

using JSonDataAccess saveToBuffer() I have a very uncomfortable way to get a JSON or a QVariantMap, as well as QVariantList.

now I'm in a special usecase compact the resulting string of saveToBuffer()

Here are the rules:

remove all line breaks

remove all white space in front and behind {}

{remove all white space in front of and behind}

remove all white space in front and behind]

[remove all white space in front of and behind]

remove all white space in front and behind:

remove all white space in front and behind.

all other areas must remain so:

{'Name': 'Jane Doe'}

{'City': 'Boston'}

becomes:

{'Name': 'Jane Doe', 'City': 'Boston'}

Thanks for the tips

Oh, according to this page (http://www.freshbrewedcodes.com/jimcowart/2013/01/29/what-you-might-not-know-about-json-stringify/) JSON.stringify () produces the compact shape directly. If you can use QML here, you should be able to convert with JSON.stringify (JSON.parse (yourdata)).

Tags: BlackBerry Developers

Similar Questions

  • Strip special characters in emails

    Hello

    I have a requirement to clean e-mail ID on our source before having filled through. However, there is a particular scenario that I can't code to cut the special characters of the email before passing through a regular expression that checks for the validation of the email.

    anyone would be able to tell me how I can do this using regexp. I guessing his regexp_replace but I don't know how to use it to escape occurrences only

    ITH abc as

    (' select ' [email protected]% $£ ' £$ %' as a double email )

    Union of all the

    Select ' [email protected] * ¬ @' as a double e-mail)

    Select regexp_replace(email,'[[:punct:]]','') from abc

    ;

    However, I do not want to replace all occurrences of @ or _ or. etc. which are part of a valid, only the finer e-mail id.

    The above obviously just replaces all signs of punctuation as an approach to coverage that is false.

    Seems you asked for zero or more


    with abc as

    (' select ' [email protected]% $£ ' £$ %' as email of all the double union)

    Select ' [email protected]' as email of all the double union

    Select ' [email protected]* ¬ @' as a double email

    )

    Select email, cleaned regexp_replace(email,'[[:punct:]]*$')

    ABC

    EMAIL CLEANED
    " [email protected]% $£ ' £$ % [email protected]
    [email protected] [email protected]
    [email protected]* ¬ @. [email protected]

    Concerning

    Etbin

  • problem with trigger to block certain characters

    Hello
    This is the structure of the table
    create table alarmtp(alamtp char)
    The condition is that the table should allow only 2 characters (V or H), if we try to insert other than these 2 characters it should trigger an error...
    So I wrote the following trigger
    create or replace trigger block_tp
     after insert or update 
     of alamtp on alarmtp
     referencing new as new old as old
     for each row
     WHEN (NEW.ALAMTP ='V' OR NEW.ALAMTP='H') 
    begin
     if((:old.alamtp <>'V' AND :old.alamtp <>'H') OR (:new.alamtp<>'V' AND :new.alamtp<>'H')) then
      raise_application_error(-20100,'not allowed');
     end if;
    end; 
    / 
    But the following insert statement runs instead of trigger the error...
    insert into alarmtp values('A')
    The above line is inserted... But do not

    Could you please give the trick to change the trigger

    Thank you
    SQL>  create table alarmtp (alamtp char)
    /
    Table created.
    
    SQL>  create or replace trigger block_tp
       after insert or update of alamtp
       on alarmtp
       for each row
       when (new.alamtp not in('V', 'H'))
    begin
       raise_application_error (-20100, 'not allowed');
    end block_tp;
    /
    Trigger created.
    
    SQL>  insert into alarmtp values ('A')
    /
    insert into alarmtp values ('A')
    Error at line 19
    ORA-20100: not allowed
    ORA-06512: at "MICHAEL.BLOCK_TP", line 2
    ORA-04088: error during execution of trigger 'MICHAEL.BLOCK_TP'
    
    SQL>  insert into alarmtp values ('H')
    /
    1 row created.
    
    SQL>  insert into alarmtp values ('V')
    /
    1 row created.
    
    SQL>  insert into alarmtp values ('X')
    /
    insert into alarmtp values ('X')
    Error at line 28
    ORA-20100: not allowed
    ORA-06512: at "MICHAEL.BLOCK_TP", line 2
    ORA-04088: error during execution of trigger 'MICHAEL.BLOCK_TP'
    

    BTW. You are most probably catch a Tartar when you use a char data type: I recommend to varchar2.

  • Regex to exclude certain characters

    I would like to differentiate lines with alphanumeric strings (more ' _' char) containing '%' and those not containing '% '.

    I came up with the following example, but obviously my regex are not correct...

    Select

    Col has,

    case

    When REGEXP_LIKE (col,'^ [[: alnum:] _ %] + $') then 'like '.

    Where REGEXP_LIKE (col,'^ [[: alnum:] _] + $') then 'word '.

    Another null

    end b

    Of

    (

    Select "eTR % t_u" double pass

    Union

    Select '% GYh % t1' double neck

    Union

    Select '4_OPhfk' double neck

    Union

    Select "vien" double pass

    );

    AB

    --------------- ---------------

    GYh % Q1%as
    4_OPhfkas
    Sandrineas
    eTR % t_uas

    This should output:

    AB

    --------------- ---------------

    GYh % Q1%as
    4_OPhfkWord
    SandrineWord
    eTR % t_uas

    I also tried [[: alnum:] _ [^ %]] + but it does not work

    Could someone give an overview about the correct use regexes?

    Thank you

    So, you have to be more precise, for example: "REGEXP_LIKE (col,'^(\w|_|%). * ? ($') and instr (col, '%'). "= 0 then 'like" ".

  • Re: How to reset the password or do a factory reset on Laserjet Pro M225DN MFP

    Please, I beg you. I asked to please. This printer is darn screwed up the password, not me. I copy - paste bro, it's the right password.

    I think the printer must strip certain characters when present you it, I used my stupid password generator that has very aggressive settings. So bad it does not tell us what characters are problematic. Both and the user manual has no instructions to reset as any other printer out there. Also too bad that someone has not yet responded. It is a new machine and I need the admin password please!

    Hi @Stormy4,

    Thanks for dropping by the HP's Support Forums! I see you try to reset your MFP HP LaserJet Pro M225dn.

    I sent you a private message on the Forums. Please go to your userpage to the right of your username, you will see your Inbox.

    Let me know the results. If this resolves the problem please let others know to mark this message as "accept as Solution".  Just say thank you, please click the ' Thumbs Up ' button. If you need more assistance let me know and I will gladly do whatever I can to help.

  • The function of enter the characters of left, right or middle of the member name?

    Does anyone know of a function or set of functions I can use to enter characters in a member name in a similar way to the functions of Excel RIGHT, LEFT, or MID? I would like to be able to write a rule to retrieve only certain characters in a member name.

    Hello

    If you look briefly into the ref of technology so you can find @SUBSTRING (String StartPosition [, EndPosition])

    StartPosition

    Beginning at the character position in a string to be included in the substring. An integer greater than or equal to 0, where 0 is the first character in the string, 1 corresponds to the second character and so forth.

    Final position

    As an option. An integer greater than or equal to 1, where 1 corresponds to the first character in the string, 2 corresponds to the second character and so forth. If the end position is not specified or is less than StartPosition, Essbase returns all other characters in the source string. Note that this is a different numbering scheme that uses the starting position.

    Now, I hope you have a good naming convention.

    Kind regards

    Philip Hulsebosch

  • Accented characters with diacritic folding the flag

    Hello

    When you use '-sign diacritic folding "indicator dgidx, is it possible to ignore certain characters of equivalent single accented character ASCII mapping?

    For example, I have this option enabled, but I need "n" and "n" behave as two different characters.

    Is this possible?

    Thank you

    Published by: mk.s on April 12, 2013 05:33

    There is not beyond the capacity of the box that I know. You could start a feature through support.oracle.com request for you to be able to define exceptions, and if you do, I would recommend including some use cases to explain the requirement of the company.

    The only way I can think to do this with the current software is a workaround - you must have a preprocessing step to map the character from one point of different code, then when you submit your search apply the same translation. I did previously to work around the problems of code points not supported (in short versions) in language thai and it works but you need to add a manipulator to your pipeline (or make the transformation in the data extract) and have a simple code before sending the query to short (before ENEQuery if via the API).

    Thank you

    Michael

  • Special characters in password?

    What are the rules for passwords? Thank you.

    We felt to create a problem when the password included a character @.

    Published by: davejjj on April 2, 2013 09:17

    davejjj wrote:
    So why Oracle accept passwords that include the character @? Why didn't he simply reject them? Or how can they be rejected in the future? Thank you.

    Published by: davejjj on April 2, 2013 10:18

    they can be denied using a function of complexity of password, such as specified in the user profile. See http://docs.oracle.com/cd/B28359_01/network.111/b28531/authentication.htm#i1007341 for a discussion. After reading it, before you do anything, think about these points, which are perhaps not so obvious

    (1) you don't have to use the provided, either in the content or name. The name of the function to use is specified in the profiledefinition. And since you can have multiple profiles (for example, one for ordinary users, the other for the DBA) each profile can specify its own audit function.

    (2) the function is just a bunch of PL/sQL code. There is no magic here. You can code to do what you want - apply different rules of complexity, to require that certain characters, reject some characters, etc. At my last store I specifically rejected 3 different special characters that had proved to be problematic, because the password could pass through systems which would take these characters as a kind of beacon. '@' in a connection string. ' $' in a shell script. And believe it or not, "#" when used by Oracle Forms.

  • Satellite Pro L20 keyboard problems not fixed by the update of the BIOS

    Hello

    When I type in MS Word or another application, certain characters are not displayed. This problem is known.
    I followed the recommendation of the TOSHIBA BIOS V1.30 for PSL25E update. Unfortunatey, it does not help.
    I would be gateful to any Advisor.

    Thank you
    olbur

    Hi Olbur

    I didn't find any official document on this subject, as you say, known issue. Can you please send a link?

    I have the Satellite L20 and there is not much difference for Satellite Pro L20 and I have no such problems, but I'm interesting about this. The L20 keyboard is not the best one, but all the characters are not displayed correctly. Maybe you type fast. ;)

  • Access to TM backup files

    I have a problem (of my own making) with my TC and TM.

    Following a travel and home renovation work (over a year) I plugged my TC back in and, unfortunately, I changed the name of it (I had read somewhere that my new OS (Yosemite) did not have certain characters in the name).

    Unfortunately, now my TM does not recognize backups. Change the name of return did not help

    I see a picture of my old backup sparsebundle in Finder, but how do I access files on it if TM do not see?

    Just to be clear, I continued to use my mac in the meantime so I don't want to restore a full backup - but there are some audio files that I would like to restore.

    Thanks in advance

    Bob

    Hold down the option key on your Mac while you click on the "clock" icon Time machine at the top of the screen.

    Click Browse other Time Machine disks

    Select the hard disk... called 'Data', unless you have changed the name of the player

    Click on the selected drive to use... or... you can hear using this drive

    See if your old backups are there

  • Toshiba 39L4363DG TV loses the WIFI settings using sentences of past

    I bought a Toshiba 394363 DG TV two weeks ago.

    This model has a problem absolutely disruptive: enter the settings in a long passphrase of WPA2-AES network WIFI (manual or assisted), connection, WIFI works very well. But the next launch of television, the setting is gone.

    I brought the TV to the store the next day, and the technician entered the passphrase from one of its own access points. _Restart, saved password. _
    The sentence of the shop _AP was strong of 8 characters, _ only of letters and numbers.

    My sentence is long as using extended characters of the flexible keyboard more of 30 letters. However, I got a new TV (same model) of the battery to the shop, set up at the House and guess what: lost password on the next reboot.

    Go so in the end, I think it's definitely a software problem, the Toshiba TV does not support the long (you can enter 63 characters according to the standard and the TV will) expression or certain characters inside. Works using a weak password.

    Toshiba should solve this problem, because it is not a solution to choose a simple sentence for APs.
    As a node aside: I have 8 clients who work well with my AP the long sentence, even a simple Nintendo WII handling.

    I guess that if there is a software problem, an update of the firmware should fix it.
    But as far as I know the TV supports the Wi - Fi® Protected Setup (WPS).
    This Wi - Fi® Protected Setup (WPS) allows to automatically configure new wireless networks, add new devices and enable security. Then you n t need to insert the password manually.
    It would be interesting to know if TV would take this type of configuration.

    Otherwise I think you should contact the service point in your country to address this issue

  • Range of channels as a box element is not included

    I used the next bit of code to translate certain characters in the string into a Base36 but I discovered the element box with a range of chain is not included.  For example, the following code executes the default case for a character "Z".  Why is the range element string 'A'... "' Z ' not understood his last item, but a beach digital 1.10 would be?  Is this a bug?

    The help of LV:

    For each case, use the labeling tool to enter a single value or lists and ranges of values in the tag selector at the top of the structure of the business case. For lists, use commas to separate values. For digital beaches, specify a range as 10.20, which means that all the numbers from 10 to 20 inclusively. You can also use beaches open to all. For example... 100 represents all numbers the diameter is equal to or less than 100 and 100... represents all numbers is greater than or equal to 100. For strings varies, a range a... c includes all channels starting with a or b, but not c. A range of one... c, c understands the value of end of c.

    Edit: A totally separate debate is if this is the desired behavior.  I tend to say no, but I'm still curious why this behavior was chosen in the first place.

  • help with a completely useless applet

    Hello

    It's my second applet (first was an hour ago) please go easy on me.  Earlier today, I watched a great webex and I got a little too excited about EEM, especially now I don't have to learn some TCL.  I still have a script TCL unopned bible on my shelf I brought just never pick me up!

    I'm trying to understand the use of 'while/end' and ' if/else' statements.  I created a completely useless applet that tells me off every time I have stop the loopback100 on my router interface.  It worked perfectly, and I even managed to get the e-mail accounts of the variable name based on who is connected.

    What I want to do now, is to send an e-mail if the user persists and closed at the interface of loopback100 3 times.

    Event Manager environment _email_server X.X.X.X

    Event Manager environment company @company.com
    environment events counter manager 3

    no event manager applet lo100protector
    Event Manager applet lo100protector
    event model syslog 'Interface Loopback100, state change down administratively' period 1

    Action 1.0 all $counter gt 0
    command action 2.1 cli 'enable '.
    Action 2.2 cli command "view".
    Action 2.3 regexp ' [a - z] +------. " "[a - z] +" "$_cli_result" username! RegExp relavent not particularly
    Action 2.4 syslog msg "Hello $username".
    Action 2.5 syslog msg "Please do not stop loopback100!"
    cli command measure 2.6 'enable '.
    Action 2.7, «config t» cli command
    "action 2.8, command cli" int lo100 ".
    action 2.9 cli command 'no shut '.
    Action 3.0 cli command "quit".
    Action 3.1 cli command "quit".
    Action 3.2 subtract $counter 1
    Action 3.3 puts $counter! I put this to "solve" the problem (if you can call it that).  Always returns a value of 3
    3.4 action ended
    command cli action 4.0 'enable '.
    action 4.1 cli command ' see the race | hostname Inc.
    4.2 action '[a-z]+_[a-z]+[0-1]_f[0-9]_[a-z]+[0-1]' regexp ' $_cli_result ' hostname! Neither is this one.
    e-mail action 5.0 Server "$_email_server" "company of $$username ' of ' company of $$hostname" subj "this email was generated by EEM on $hostname" body "Please stop you by train to stop the loopback100 interface!  It's not big or clever. "source-int vlan1
    Action 5.1 syslog msg 'email sent to $username.
    game action 6.0 counter 3

    so.  The first problem I have is that my $counter variable never seem to decrement.

    The second problem I have is that it seems to be a loop statement.  I see the statement "Please do not stop loopback100!" several times.  Although it seems don't last forever, only a few times.

    I tested it without one while loop in it and everything seems to be good.  Someone would be nice enough to put me in the right direction please?

    A few other random questions.

    Is it possible that I can put a charater directly after a variable?  For example in action 2.4, I seem not to be able to put a "!" after the $username without a space variable has ' ' Hello $username!

    Server mail action 5.0 command struck roughly of the charater line limit.  Is it possible that I can break the order into its components?

    Thank you very much in advance

    A bit too excited, Alex

    Thank you for attending the webinar.  I'm glad that you found it informative.

    Congratulations on your first applet.  What you want to do is possible, but you cannot set environment variables locally.  Those who cannot be defined that turning in the configuration mode t and their reset.  There are some other counters that you can use, however.  One idea is to use a meter of EEM.  Should be a different policy, but you can accomplish what you want with what follows.

    event manager applet lo100protector

    event syslog pattern "Interface Loopback100, changed state to administratively down" period 1

    action 1.0 counter name lo100cnt op dec 1

    action 1.1 if $_counter_value_remain gt 0

    action 2.1  cli command "enable"

    action 2.2  cli command "show users"

    action 2.3  regexp "[a-z]+\.[a-z]+" "$_cli_result"   username

    action 2.4  syslog msg "hello $username"

    action 2.5  syslog msg "Please don't shutdown loopback100!"

    action 2.7  cli command "config t"

    action 2.8  cli command "int lo100"

    action 2.9  cli command "no shut"

    action 3.0  cli command "end"

    action 3.4 else

    action 4.1  info type routername

    action 5.0  mail server "$_email_server" to "$username$company"  from  "$_info_routername$company" subj "This email was generated by EEM  on $_info_routername"  body "Please will you stop trying to shutdown the  loopback100  interface!  It's not big or clever." source-int vlan1

    action 5.1  syslog msg "email sent to $username"

    action 6.0 end

    event manager applet lo100counter

    event counter name lo100cnt entry-op le entry-val 0 exit-val ge exit-val 0
    action 1.0 counter name lo100cnt op set value 3

    Applet variable treatment is fairly primitive.  So, you will not be able to keep some names of variables with certain characters.  The '!' is such a character.  You will need a space.

    About the length of the command, at some point you will need to exit this Tcl book :-).  The applets are powerful, but that you begin to build more complex applications and larger, you will need a more fully functional programming language.

  • cp1252 encoding

    Hello

    I'm developing an application using JDE 4.2.1. The application communicates with http Post send content XML encoded in ISO-8859-1 and receives another XML encoded with cp1252 (windows-1252 encoding). I can't change the encoding in the answer, so I need to 'recode' to ISO-8859-1 to analyze.

    I found that the conversion between these encodings has a problem with certain characters, including "<' and="" '="">", so I can't properly analyze.

    I receive the information in an InputStream I read with InputStream.available and write each byte in a ByteArrayOutputStream. Then I transform transform into a String in this way:

    String xmlFile = new String (out.toByteArray (), "cp1252");

    If I print it in the console those contradictory characters are not well printed, then I start to think that "cp1252" encoding is not supported by default. I'm wrong?

    Y at - it somehow to transform a string containing the xmlFIle encoded with cp1252 to another string encoded in ISO-8859-1?

    Thanks in advance.

    You can try adding the header "x-rim-transcode-content' with the 'none' value both the request and the response. That could help.

  • How to avoid accepting of names of files with windows 7! ?

    older programs have problems with file names that have certain characters in them, in order to avoid compatibility problems are causing the more recent additions to windows 7 in the office how to change the setting to prevent users from file naming using these characters?

    Hello

    Unfortunately, there is no way to prevent Windows 7 to accept the valid special character. Until you use / possible valid characters he will have no problems with Windows.

    Here is the list of characters allowed and NOT allowed characters in Windows.

    The following special characters are allowed in the names of files and folders:

    ! # $ % & ' ( ) + , - .

    ; = @ [ ] ^ _ ` { } ~

    These special characters are NOT allowed in the names of files and folders:

    " * / : <> ? \ |

    Probably problems will arise if the file names or folder containing any of the following characters.

    If you attempt to download a file that contains one of these characters, you will receive an appropriate message. You will then need to rename the file before you can download successfully.

    Note:

    You cannot start a file name or a folder with a space (empty). White left will be deleted from the file name or folder

Maybe you are looking for

  • Satellite Pro L100 - Crash during the update of the Bios

    Hello I am the owner of a Satellite Pro L100 (PSLA4E) On the Toshiba site I downloaded the BIOS update. While installing I read that it was necessary to supply cable is plugged. Before I could cancel for the cable, he had started and then frozen. The

  • Windows 8, cannot get the display settings and the password for work

    I tried to change the timming 'turn off display' and "ask password on wake up" (fixed or not) to perform settings.  Whenever I stop using the computer a few seconds later, he goes to the locked screen.  The computer was a display at Costco, so maybe

  • installer of creative cloud is not install

    Adobe Creative Cloud asks me to re - install Creative Cloud Installer. Initialization of a message appears, saying that to solve the problem I have install creative cloud and pointing me to the installer of creative cloud.I'm caught in the trap!Backg

  • Develop preset continues to choose the calibration of default camera profile

    Hi, for some reason, whenever I chaque fois que je choisis choose a develop preset that does not have a specified camera calibration profile (it should be and used to be "Caméra Standard").  He would choose the first profile in the list instead of "C

  • Help! CC of Muse (2014.3) neglects the free fonts "FiraSans".

    Help! After the upgrade to Muse CC (2014.3), I got the information that the 'FiraSans' font on my site is no longer available for sites of muse. How is that possible? And what can I do? After all it s a free font. You can´t seriously throw it out of